[R] Fw: assign colnames to data

2010-03-15 Thread Xumin Zeng
Patrick, Thanks. I tried colnames, but it doesn't work. Seems more transformation is needed. But now I got names, that's good enough. Best. Xumin Patrick Burns 03/15/2010 04:04 PM To Xumin Zeng cc Subject Re: [R] assign colnames to data Those are names, not colnames

Re: [R] assign colnames to data

2010-03-15 Thread Xumin Zeng
Thanks, it works. Xumin Henrique Dallazuanna 03/15/2010 03:57 PM To Xumin Zeng cc r-help@r-project.org Subject Re: [R] assign colnames to data Try: names(a) <- b On Mon, Mar 15, 2010 at 4:55 PM, Xumin Zeng wrote: > Hi, > > Do you know how to assign colnames from

[R] assign colnames to data

2010-03-15 Thread Xumin Zeng
Hi, Do you know how to assign colnames from one list to another, for example. a=c(1,2,3) b=c("A","B","C") how can I get the dataset A B C 1 2 3 where A, B and C are colnames. Thanks. Xumin [[alternative HTML version deleted]] __ R-help@r-p

[R] error with adaboost: replacement has 186 rows, data has 62

2010-03-09 Thread Xumin Zeng
When running > AB.fit=adaboost(ylearn, xlearn, xtest, presel=0) I got the following error: Error in `[[<-.data.frame`(`*tmp*`, preds, value = c(4L, 6L, 6L, 6L, 3L, : replacement has 186 rows, data has 62 The data structure is attached below: [1] "ylearn" [1] 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0

[R] error with adaboost: replacement has 186 rows, data has 62

2010-03-09 Thread Xumin Zeng
Hi, all, When running > AB.fit=adaboost(ylearn, xlearn, xtest, presel=0) I got the following error: Error in `[[<-.data.frame`(`*tmp*`, preds, value = c(4L, 6L, 6L, 6L, 3L, : replacement has 186 rows, data has 62 The data structure is attached below: [1] "ylearn" [1] 0 0 0 0 0 0 0 0

Re: [R] Odp: how to convert character variables into numeric variables directly

2010-03-09 Thread Xumin Zeng
Thanks! Xumin Petr PIKAL 03/09/2010 01:57 AM To Xumin Zeng cc r-help Subject Odp: [R] how to convert character variables into numeric variables directly Hi r-help-boun...@r-project.org napsal dne 08.03.2010 18:55:10: > Here is the example. > > > age=18:29

[R] error when using svm routine: Error in if (any(co)) { : missing value where TRUE/FALSE needed

2010-03-08 Thread Xumin Zeng
Hi, I met with this error message with the following data set. Do you know how to resolve it? Thanks. > data<-read.table("c://temp3//abc.csv", sep = ",", header=T) > classwt<-c( 0.5806452, 0.4193548) > y<-data[,1] > x<-data[,2:ncol(data)] > print(y) [1] 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 1 1 1 1 1

Re: [R] how to convert character variables into numeric variables directly

2010-03-08 Thread Xumin Zeng
Thanks, it works! Xumin milton ruser 03/08/2010 01:02 PM To Xumin Zeng cc r-help Subject Re: [R] how to convert character variables into numeric variables directly Try: as.numeric(as.character( typec)) milton On Mon, Mar 8, 2010 at 12:55 PM, Xumin Zeng wrote: Here is the example

[R] how to convert character variables into numeric variables directly

2010-03-08 Thread Xumin Zeng
Here is the example. > age=18:29 > height=c(76.1,77,78.1,78.2,78.8,79.7,79.9,81.1,81.2,81.8,82.8,83.5) > type=c("A", "B", "C", "D","A", "B", "C", "D","A", "B", "C", "D") > typec=c("0","4","2","9","0","7","2","3","0","1","2","3") > typen=c(0,1,2,3,0,1,2,3,0,1,2,3) > data1=data.frame(age=age,height=