On 01/26/2010 09:15 PM, Peter Rote wrote:

I still struggling with this:

  error massage:

  by(AlexETF,AlexETF$Industry,function(a) {filename = paste("C:/ab/",gsub("
","",a$Industry[1]),".txt",sep="")
+         print(filename)
+ write.table(a[,3,drop=FALSE],quote=FALSE,col.names=FALSE,row.names=FALSE)
+     }
+  )

[1] "C:/ab/Accident&HealthInsurance.txt"
Error in `[.data.frame`(a, , 3, drop = FALSE) :
   undefined columns selected

Hi Peter,
I would suggest that you print the first say 10 rows of "a" and see if it has three columns.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to