I've only recently started using RStudio to learn R, so I may have some fundamental questions. Regarding the "sample" function, one of them. My dataset contains 402224 observations across 147 different variables, to be more precise. My job is to create a dataframe from a sample of 50 observations, then go on. However, y = sample(mydata, 50, replace = TRUE, prob = NULL) results in a dataset with 40224 observations over 50 variables when the function sample is called. That is, variables rather than objectives are sampled.
Have you thought about why it occurs? I want to say thank you.