# create data frame called mydata
n <- 12
X <- sample(c("Group1","Group2"), size=n, replace=TRUE)
Y <- rnorm(n=n, mean=50, sd=10)
mydata <- data.frame(X,Y)
# write the contents of a data frame called mydata
# into a csv file called "mydata.csv" in the working directory
# out()
# same as above, but specify the name of the output file name
out("mybestdata.csv")
Run the code above in your browser using DataLab