Examveda

In R, how do you add a new column named Height to a data frame named my_data?

A. my_data$Height <- c(160, 170, 155)

B. add_column(my_data, "Height", c(160, 170, 155))

C. my_data[,"Height"] <- c(160, 170, 155)

D. append_column(my_data, "Height", c(160, 170, 155))

Answer: Option A


This Question Belongs to R Programming >> Data Structures In R Programming

Join The Discussion

Related Questions on Data Structures in R Programming