On May 11, 2010, at 9:00 AM, Terry Bassett wrote:

I am using R to read from an excel(csv) file. Within the excel file is a column with the date set that looks likes this:

 53:40.2
and in the Insert function box it looks likes this:
9/21/2006  4:53:40 PM

This is really an Excel question, rather than an R one. You need to format the data in Excel so that it gets output to the CSV properly.


I tired separating the time and date using the function below and then plotting again which fail to read properly
=TEXT(B2,"hh:mm:ss")   and  =TEXT(B9,"mm/dd/yyyy")

As I said, it's an Excel question.


The R script am using is
plot.time_vs_id<- function(start,end){
setwd("C:/Documents and Settings/terry/Desktop/r_stuff")
x=read.table("MAV.csv",header=T, sep=",")
plot(x$time[start:end],x$packet_id[start:end],ylab="Packet ID", xlab="Time", type="p")
}

and
plot.hov_Points <- function(start,end){
setwd("C:/Documents and Settings/terry/Desktop/r_stuff")
library(rgl)
t=read.table("MAV.csv",header=T, sep=",")
plot3d(t$time[start:end],t$packet_length[start:end],t $date[start:end], main="potential", xlab="time", ylab="length",zlab="date", type="p")
}

How can i get R to properly display the time in my graphs

Thanks
Terry Bassett



David Winsemius, MD
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