[R] Rearranging columns with cbind

2011-04-21 Thread vin691
I'm getting an error that I don't understand when trying to rearrange my data columns with cbind. My data is in 27 columns, like so: > data <- read.table("CalledFeatsNimblegen.csv", header=T, sep=",") > names(data) [1] "MF_not_mC" "MF_promoter""MF_genebody" "FF_not_mC"

Re: [R] Rearranging columns with cbind

2011-04-21 Thread Cliff Clive
It's just a typo. You're missing a comma at the beginning of your index, and you should list all of the rows in a vector, like this: data[, c(19:27, 1:12, 13:15, 16:18)] The way you entered it, R is looking for rows 19:27, columns 1:12, and doesn't know what to do with the other numbers. -- View