[R] Filter data

Petr PIKAL petr.pikal at precheza.cz
Fri Dec 3 11:01:24 CET 2010


Hi

Hm. Does str(poli) revealed said explicitly that poli is data frame? I 
presume that it told you that it is list. In that case you need to use 
appropriate indexing, which suits structure of your list.

Regards

r-help-bounces at r-project.org napsal dne 02.12.2010 22:06:15:

> 
> Simplified version of str(poli): (real dataset includes 36 variables)
> 
>  $ country : chr [1:15846] "Afghanistan             " "Afghanistan  
> " "Afghanistan             " "Afghanistan             " ...
>  $ year    : num [1:15846] 1800 1801 1802 1803 1804 ...
>  $ democ   : num [1:15846] 1 1 1 1 1 1 1 1 1 1 ...
>  $ autoc   : num [1:15846] 7 7 7 7 7 7 7 7 7 7 ...
>  $ polity  : num [1:15846] -6 -6 -6 -6 -6 -6 -6 -6 -6 -6 ...
>  $ polity2 : num [1:15846] -6 -6 -6 -6 -6 -6 -6 -6 -6 -6 ...
> - attr(*, "label.table")=List of 36
>   ..$ country : NULL
>   ..$ year    : NULL
>   ..$ democ   : NULL
>   ..$ autoc   : NULL
>   ..$ polity  : NULL
>   ..$ polity2 : NULL
> 
> 
> 
> 
> -----
> Diogenas
> -- 
> View this message in context: http://r.789695.n4.nabble.com/Filter-data-
> tp3070069p3070201.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list