[R] List into table

Andtrei89 andreas1tr at web.de
Wed Jun 5 10:49:55 CEST 2013


Hi everyone,

I want to open an XML file in R and it also works.
But then I get a list of all numbers but it isn't in the type of "numeric".

I tried this:

exampleData <-
"C:/Users/Andreas/Desktop/Thesis/Interzeptionsmodell/Daten/Karlsruhe/Windgeschwindigkeit/1948.xml"

F <- system.file("exampleData", "1948.xml", package = "XML")
f <- xmlToDataFrame(exampleData, colClasses = NULL, homogeneous = TRUE,
collectNames = TRUE,
                    stringsAsFactors = default.stringsAsFactors())


I got this:

1 4.9 5.0 5.3 4.4 2.9 1.9 1.1 1.5 1.6 1.2 0.7 0.8 2.5 2.3 1.6 0.6 1.3 0.8
1.3 1.2 3.9 5.0 6.4 6.3 8.4
   NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA 
NA  NA  NA  NA  NA  NA  NA
1 8.4 8.3 8.3 9.1 8.3 7.7 6.8 5.4 4.8 3.6 3.6 3.5 2.6 3.5 3.0 3.1 2.4 3.4
3.3 4.8 6.1 5.1 4.2 4.5 4.5
   NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA 
NA  NA  NA  NA  NA  NA  NA
1 5.4 4.7 4.6 3.8 4.0 1.5 0.0 1.1 0.7 0.0 0.0 1.3 1.5 1.6 0.0 0.7 0.6 0.5
1.8 1.5 1.6 1.5 1.9 2.5 2.5

I only want the numbers out of it as numeric ... if I try as.numeric() I got
a list looking like that:

1 1 1 1 1 1 1 1 1  1  1 1 1 1 1 1 ..........

I would be very thankful for your answer

Andy
  



--
View this message in context: http://r.789695.n4.nabble.com/List-into-table-tp4668693.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list