in R programming, how do I subset a matrix so that I can skip columns in between? I only know how to do it continuously such as 1:4, but what if I want the first, second, and fourth colum
Asked
Active
Viewed 84 times
1 Answers
1
You can select specific columns as follows:
new_df <- x[,c(1,2,4)]# Select column 1,2 and 4

Víctor Cortés
- 473
- 4
- 9