I have loaded a csv file to R.
There are 10 columns in the file.
I want to save the 1st 3rd and 5th column to a new file. What is the c
First, I'll answer your question. If d
is your data frame loaded from your file, then:
d_subset = d[,c(1,3,5)]
write.csv(d_subset, file="file.csv")
Second, I'll give you some advice. Read the documentation or buy a good R book. You can even download An introduction to R for free. Many of the questions you are asking are very basic. While most people are happy to handle the odd basic question, asking three or four a day really isn't sustainable.