In R - say I have a dataset (data) with the columns "mpg", "car", "cylinders". Is there a way to display the first 10 rows of data for just "mpg" and "car"?
head(data,10) works fine, but displays all 3 columns - I wasn't sure if there was a way to display less columns without actually subsetting?
head(data,10)
Try
head(data[c("mpg","car")],10)
or
head(data,10)[c("mpg","car")]
1.4m articles
1.4m replys
5 comments
57.0k users