"LA" "NA." ...
# Index: Class 'yearmon' num [1:6] 2012 2012 2013 2013 2013 ...
plot(x2$NA.,type="l",ylab="M kg/y",xlab="") #works for me.
#
plot(x2$`NA`,type='l',ylab='M kg/ y ',xlab='') #also works (as sugges
Try x1$`NA` instead of x1$NA.
HTH
Quoting eric :
I inserted na.strings='' and that seemed to work except for a problem with a
plot statement
plot(x1$NA,type='l',ylab='M kg/ y ',xlab='')
Error: unexpected numeric constant in "plot(x1$NA"
tail(x1)
AP EU LANA total
Jun 20
I inserted na.strings='' and that seemed to work except for a problem with a
plot statement
plot(x1$NA,type='l',ylab='M kg/ y ',xlab='')
Error: unexpected numeric constant in "plot(x1$NA"
> tail(x1)
AP EU LANA total
Jun 2012 2.32 2.26 5.38 13.74 23.70
Jul 2012 2.46 2.21 5.33 1
AM"
A.K.
----- Original Message -----
From: eric
To: r-help@r-project.org
Cc:
Sent: Sunday, November 18, 2012 4:18 PM
Subject: [R] Replace with something else
I am reading some data into R from an Excel spreadsheet using read.csv. Some
of the original data that comes into column 1 from t
use na.strings = ''
> x <- read.table(text = "635 LA 201207 557329
+ 636 LA 201208 683771
+ 637 LA 201209 613851
+ 638 LA 201210 764217
+ 639 LA 201211 212897
+ 782 NA 200701 875634
+ 783 NA 200702 614856
+ 784 NA 200703 521520
+ 785 NA 200704 1406400", as.is
I am reading some data into R from an Excel spreadsheet using read.csv. Some
of the original data that comes into column 1 from the spreadsheet is text
that says NA. The NA stands for north america. As it comes in, R converts
the NA over to .
What is the cleanest way to change the values to so
6 matches
Mail list logo