[R] Coercing a list to integer?

Jacques VESLOT jacques.veslot at cirad.fr
Wed Jan 18 15:43:54 CET 2006


of course unlist()/as.list() do that !!! (sorry, i am tired)

Norman Goodacre a écrit :

> Dear group,
>  
>    I am nearly beside myself. After an entire night spent on a  niggling little detail, I am no closer to to the truth. I loaded an  Excel file in .csv form into R. It apparentely loads as a list, but not  the kind of list you can use. Oh no, it converts into a list that  cannot be converted into an integer, numeric, or vector, only a matrix,  whihc is useless without integers.
>  
>    How can I get a list of the form [1] 1,2,3,4,5 into the form [1]  1 [2] 2 [3] 3 [4] 4 [5] 5? Depending on hwo you define a list,  apparentely, it goes one way or the other.
>  
>   x <- list(1:5) means you have [1] 1,2,3,4,5
>  y <- list(1,2,3,4,5) means you have [1] 1 [2] 2 [3] 3 [4] 4 [5] 5
>  
>  Can anyone help?#
>  
>  I woudl greatly appreciate it.
>  
>  Sincerely,
>  Norman Goodacre
>  
>
>		
>---------------------------------
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>  
>




More information about the R-help mailing list