I'm trying to use a table I have on an external file by importing it and using it to make some graphics.
On the blank spaces in this document I put NA, but it still considering them as values...
How can I make it so these values are considered non-existing ?
My script:
datafilename <- "SGX.txt"
person.data <- read.table(datafilename, header=TRUE, na.strings = c("NA", " "))
panel.cor <- function(x, y, digits=2, prefix="", cex.cor, ...)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- abs(cor(x, y))
txt <- format(c(r, 0.123456789), digits=digits)[1]
txt <- paste(prefix, txt, sep="")
if(missing(cex.cor)) cex.cor <- 0.8/strwidth(txt)
text(0.5, 0.5, txt, cex = cex.cor * r)
}
pairs(~O3_s+NO2_s+CO_s1+CO_s2+T_ref+HR_ref+HA_ref+PP_ref+Rad_ref+VV_ref+DV_ref+P_ref, data=person.data,
upper.panel=panel.smooth, lower.panel=panel.cor,
pch=20, main="SGX Scatterplot Matrix")
summary(person.data)
boxplot(person.data)
PS: I'm using R, codeproject didn't recognize the tag so I put programming.