[R] HELP boxplot for time class
uvilla
maruchavez83 at hotmail.com
Sat Dec 5 12:52:11 CET 2009
hi again
I will try this time to explain my problem clearly
I have the following data from the file skiing.csv (3 first rows)
protokollid date start end
1 4 2/23/2009 8:50:10 15:17:30
2 4 2/24/2009 9:47:00 13:52:25
3 5 3/22/2009 8:51:25 12:00:05
I have the following script
library(chron)
skiers=read.csv("skiing.csv")
strptime("08:50:10","%H:%M:%S")
start=times(skiers[,3])
strptime(start,"%H:%M:%S")
end=times(skiers[,4])
strptime(end,"%H:%M:%S")
#calc lenght of the route
length.route=end-start
#calc medians
median(start)
median(length.route)
Then I want to do a box plot of the staring time
when I use:
boxplot(start)
this error appears: Warning message:
In is.na(x) : is.na() applied to non-(list or vector) of type 'NULL'
when I try to convert start as POSIXct
> start=as.POSIXct(start)
Error in as.POSIXct.default(start) :
do not know how to convert 'start' to class "POSIXlt"
and when I try to convert skiers[,3] as POSIXct
> skiers[,3]=as.POSIXct(skiers[,3])
Error in as.POSIXlt.character(as.character(x)) :
character string is not in a standard unambiguous format
start is of "times" class and skiers[,3] of "factor" class
I want to do a boxplot of the starting time of my data, which reflect the
median " 08:36:45", and all O get in the y axis are decimal numbers :(
Help please
Best regards
Maria Stauss
--
View this message in context: http://n4.nabble.com/HELP-boxplot-for-time-class-tp949154p949154.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list