On Jul 16, 2012, at 1:26 PM, John Kane wrote:

Yolande,
Attached files are usually deleted from the r-help list and I see no sign of your file.

If you said that most attached files are scrubbed because posters did not read the Posting guide to determine which file types were acceptable, then you would be correct. But you give the impression that files are always scrubbed. This is not true. Attached are two small files, a mime-text file and a pdf file.

a 2
b 3
c 4



Attachment: small2.pdf
Description: Adobe PDF document





You can use the function dput() to output the your file in a format that you can paste into your email and which other readers can paste into R and use.

See ?dput for more information.

John Kane
Kingston ON Canada


-----Original Message-----
From: yolande....@gmail.com
Sent: Mon, 16 Jul 2012 11:17:43 -0400
To: r-help@r-project.org
Subject: [R] as.xts

Hello,

Attached is the file created from as.xts. After submitting the following
code, I got an error. Please help. Thanks.
diveCond <- data.frame(matrix(0, nrow=61, ncol=17))
names(diveCond) <- c("dive_id", "timestamp", "visability", "r_wvht",
"r_dpd", "r_apt", "r_mwd", "r_wtmp", "l_salinity", "l_o2", "l_hs",
"l_tp",
"l_wdir", "l_along", "l_cross", "l_mab", "l_depth")
dive_id <- 0
for(i in unique(as.character(index(diveData_2008)))){
                  dive_id <- dive_id+1
               diveCond$dive_id[dive_id] <- dive_id
               diveCond$timestamp[dive_id] <- as.character(i)
               diveCond$visability[dive_id] <-
as.numeric(diveData_2008[i][1,11])

}
Error in if (length(c(year, month, day, hour, min, sec)) == 6 && c(year,
:
 missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In as_numeric(YYYY) : NAs introduced by coercion
2: In as_numeric(YYYY) : NAs introduced by coercion

Thanks,
Yolande



David Winsemius, MD
no longer living in West Hartford, CT

______________________________________________
R-help@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.

Reply via email to