[R] Cross-tabulation of data from database

Morten Sickel Morten.Sickel at newmedia.no
Wed Feb 27 21:17:56 CET 2002


On Wednesday 27 February 2002 09:47, Jens Nieschulze wrote:
> On Tue, 26 Feb 2002, Morten Sickel (I) wrote:
>
> % I want to (try to) use R for some analyses within vegetation ecology,
> % using the vegan package. 
(snip)
> %But I end up with:
> %Error in Summary.factor(..., na.rm = na.rm) :
> %        "sum" not meaningful for factors
>
> I guess dekningsgrad (didn't know Norwegian can be this close to
> German:Deckungsgrad) is read in as a factor. 

(on a global scale, German and Norwegian are dialects:-) )
Well, the problem turned out to be exactly the opposite. but you pointed me 
in the right direction, as I didn't know about the str() function:

> str(dca.raw)
`data.frame':   2213 obs. of  3 variables:
 $ nornavn     : chr  "Fjellmarikåpe" "Gulaks" "Harerug" "Brearve" ...
 $ dekningsgrad: num  1 3 1 1 5 50 1 5 1 3 ...
 $ ruteid      : chr  "LIASB01" "LIASB01" "LIASB01" "LIASB01" ...

so a couple of factor()s fixed it for me. 

Thanks a lot!

Morten

-- 
Morten Sickel
GIS Consultant
Drøbak, Norway
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list