I have read several other posts about how to import csv files with read.csv but skipping specific columns. However, all the examples I have found had very few columns, and so it was easy to do something like:
columnHeaders <- c("column1", "column2", "column_to_skip")
columnClasses <- c("numeric", "numeric", "NULL")
data <- read.csv(fileCSV, header = FALSE, sep = ",", col.names =
columnHeaders, colClasses = columnClasses)
I have 201 columns, without column labels. I would like to skip the last column. How would it be possible to do this without naming all the other columns to keep? Many thanks.
columnClasses <- c(rep("numeric",200), "NULL")
– Stolondata <- read.csv("../CAASPP_clustering/ca2016_1_csv_v3.zip") data_trimmed <- data[,1:(ncol(data)-1)]
– TinstonecolumnHeaders<- c(sprintf("column%d", 1:200))
– Stolon