R

Asked • 06/22/19

Extracting specific columns from a data frame?

I have an R data frame with 6 columns, and I want to create a new dataframe that only has three of the columns.Assuming my data frame is `df`, and I want to extract columns `A`, `B`, and `E`, this is the only command I can figure out: data.frame(df$A,df$B,df$E)Is there a more compact way of doing this?

2 Answers By Expert Tutors

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.