[R] Logical operators

Patrick Hausmann patrick.hausmann at uni-bremen.de
Sun Jun 9 12:25:24 CEST 2002


Hello,

I have a csv-file which looks like:

#### pwt6_r.csv ####
code;year;rgdpch
AGO;1998;1234
ALB;1998;3576
ARG;1998;#NA
SVN;1996;13439
SWE;1996;21492
AGO;1960;#NA
ALB;1960;2345
ARG;1960;4634
#### pwt6_r.csv ####

To import this file i call:
pwt6<-read.csv("d:/pwt6_r.csv",header=T,na.strings="#NA",sep=";")

Now I want to generate a new data.frame which include only 
+ observations for the years 1960 and 1998
+ where the variable 'rgdpch' has no missing values.

The result should be:

code;year;rgdpch
ALB;1998;3576
ALB;1960;2345

I tried to solve this with logical operators (==), but without any 
success.

Thanks for your help!
Patrick
-------------
Patrick Hausmann
Friedrich-Wilhelm Str. 37 - D-28199 Bremen
Tel. +49 421 5980631 - Fax. +49 421 5980632
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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