Displaying 20 results from an estimated 20000 matches similar to: "Coercing a dataframe column to datetime"
2005 Apr 23
2
How to override coerion error in 'scan'
I am using 'read.csv' in V2.0.1 to read in a CSV file with the
colClasses option and am getting an error from 'scan' when it encounters
a non-numeric value for a 'numeric' column, i.e.
> ds <- read.csv(in_file, nrows=irow, row.names=NULL,
colClasses=zclass,
comment.char="")
Error in scan(file = file, what = what, sep = sep, quote =
2004 May 07
1
Lattice xyplot - problem trying to produce multiple output files with a 'for' loop
I am stuck on trying to get the Lattice xyplot to output a separate PNG file each time through my 'for' loop. The files get produced but are empty.
Here is the code. I'm running 1.9 on Windows. BTW is there a more efficient way of creating the separate output files than looping over the levels and subsetting?
.........................................................
lev <-
2004 Jun 08
2
Is there an R-version of rayplot
I need to make plots similar to those produced by the s-plus rayplot function but can't seem to find it in R. These 'vector maps' plot a ray or vector at each specified location. Is there something similar in R ?
--Rich
Richard Kittler
AMD TDG
408-749-4099
2004 Jun 10
2
Lattice::qqmath -- groups option question
Does the 'groups' option on qqmath just color the points differently in the main distribution or does it actually overlay separate quantile plots for each subset? I would like to be able to do the latter.
--Rich
Richard Kittler
AMD TDG
408-749-4099
2010 Oct 01
3
Converting a dataframe column from string to datetime
Hi,
I have a dataframe column of the form
v<-c("Fri Feb 05 20:00:01.43000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:02.274000 2010","Fri Feb 05 20:00:06.34000 2010")
I need to convert this to datetime form. I did the following..
lapply(v,function(x){strptime(x, "%a %b %d %H:%M:%OS %Y")})
This gives me a list that looks like
2004 May 27
2
axis.POSIXct: Datetime data and plotting
I've run into a problem with the datetime axis generated by axis.POSIXct. It appears a similar issue was discussed in October 2003 under the subject line "datetime data and plotting" (see https://stat.ethz.ch/pipermail/r-help/2003-October/039071.html), but I wasn't able to determine whether there is a straightforward solution.
The code below produces a graph with apparently
2010 Jul 30
1
Formatting datetime data for gantt.chart.
Overall goal:
I'd like to have a visual representation of when certain computer applications are running over the course of a day (data will come from a SQL query later, but I'm using a csv for now). My idea is to use a gantt chart, but I'm running into issues with the start and end time. I'm wondering if it's because I need to use hours instead of days as my unit of time.
2006 May 08
1
Help on zoo and datetime series
Hello,
i would like to import this txt file:
Giorno;PM10
2006-01-01 10:10;10.3
2006-02-02 20:22;50.3
2006-03-03 23:33;20.1
.........
As it's an irregular time series i use zoo as follow:
require(zoo)
z <- read.table("c:\\1.csv", sep=";", na.strings="-999", header=TRUE)
q <- zoo(z$PM10, strptime(as.character(z$Giorno),"%Y-%m-%d %H:%M"))
At this
2004 May 19
2
POSIX to ts and back to POSIX
I am trying to use POSIX datetime objects rather than chron datetime
objects but am having difficulty with POSIX in a time series. My
question: Once a POSIXct vector is bound to a time series, is there a
function to convert back to POSIXct? The following code demonstrates
what I am trying to do.
> ts(as.POSIXct(strptime(tmp,"%m/%d/%Y %H:%M:%S")),freq=1440)
Time Series:
Start =
2015 Jul 01
5
additional leap second
hi,
Index: leap_second/src/library/base/R/zdatetime.R
===================================================================
--- leap_second/src/library/base/R/zdatetime.R (revision 68608)
+++ leap_second/src/library/base/R/zdatetime.R (working copy)
@@ -24,7 +24,8 @@
"1979-12-31", "1981-6-30", "1982-6-30", "1983-6-30",
2003 Oct 17
7
datetime data and plotting
If I take the following simple data:
YEAR MONTH DAY WEIGHT.KG
2003 10 6 1.2
2003 10 12 1.2
2003 10 16 1.3
and format the date data and plot it:
dates <- strptime(paste(DAY,MONTH,YEAR),"%d%m%Y")
plot(c(min(dates),max(dates)),c(0,max(WEIGHT.KG)),
xlab="Date",ylab="Weight (kg)",type="n")
lines(dates,WEIGHT.KG)
points(dates,WEIGHT.KG)
I find that the
2007 Aug 08
2
Error: Cannot Coerce POSIXt to POSIXct when building package
A newbie here - please forgive me if this is a basic question. We have an
in house package built in R 2.2.1 (yes we're a little behind the times at
our firm)and would like to rebuild it using R 2.5.1. However, when I try
and build the package from source, I keep getting this error:
Error in as(slotVal, slotClass, strict = FALSE) :
no method or default for coercing "POSIXt"
2009 Oct 05
6
Date-Time-Stamp input method for user-specific formats
Date-Time-Stamp input method to correctly interpret user-specific
formats:coding is 90% there - based on exmple at
http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html
...anyone got the last 10% please?
CONTEXT:
Data is received where one of the columns is a datetimestamp. At midnight,
the value represented as text in this column consists of just the date part,
e.g.
2011 Sep 08
2
help subsetting data based on date AND time
Dear R Community,
I am new to R, and have a question that I suspect may be quite simple but is
proving a formidable roadblock for me. I have a large data set that
includes water-quality measurements collected over many 24-hour periods.
The date and time of sample collection are in a combined Date/Time field in
the format yyyy-mm-dd hh:mm:ss. I need to be able to subset the data for
analysis of
2011 May 31
3
DateTime Math in R - POSIXct
Greetings -
I'm battling POSIXct, as per the code below. My input is actually an XL
file, but the weird results below correctly model what I am seeing in my
program.
Before I punt and use lubridate or timeDate, could anyone please help me
understand why POSIXct forces my variable back to GMT?
I suspect that I'm not properly coding the tzone value, but it does not
throw an
2001 Nov 26
3
Doing things with POSIXt
Dear R-Users,
I have a data file with timestamps and I wanted to use POSIXct time data
type to represent the respective column. I played around with the type and
found a couple of issues:
* there seems to be no direct way of reading datetimes into a variable.
Let's say this is my file
"1992-02-27 23:03:20 PST"
"1992-02-27 22:29:56 PST"
"1992-01-14 01:03:30 PST"
2004 Oct 19
2
Sweave and Trellis in R 2.0.0patched (Windows)
I've been using the following code to plot using Sweave in version
1.9.1
library(RODBC)
library(lattice)
channel <-odbcConnectExcel("h:/water.xls")
data <- sqlQuery(channel,"select * from `Sheet1$` where Test = 'TOC' and
(Valve='5010-05' or Valve='8030-V26' or Valve='1180-08' or
Valve='5040-08')")
odbcClose(channel)
srt <-
2005 May 11
2
time zones, daylight saving etc.
Hi, I have a whole bunch of data, which looks like:
15/03/2003 10:20 1
15/03/2003 10:21 0
15/03/2003 12:02 0
16/03/2003 06:10 0
16/03/2003 06:20 0.5
16/03/2003 06:30 0
16/03/2003 06:40 0
16/03/2003 06:50 0
18/03/2003 20:10 0.5
etc. (times given on a 24 hour clock)
and goes on for years. I have some code:
2009 Sep 18
4
Datetime conversion
I'm relatively new to R .I tried converting the datetime column with values
like 01apr1985:00:00:00.000 using strptime(datetime,"%d%b%Y).Could anyone
help me in this regard .Please reply ASAP i need .
--
View this message in context: http://www.nabble.com/Datetime-conversion-tp25503138p25503138.html
Sent from the R help mailing list archive at Nabble.com.
2012 May 30
1
fractional seconds in POSIXct
Hi,
Using the following simple character vector representing a time series
with fractional seconds:
datetime <- c("20/09/2011 13:00:59.00", "20/09/2011 13:00:59.02",
"20/09/2011 13:00:59.04")
Conversion to POSIXct runs into problems; the second element is not
interpreted correctly:
---<--------------------cut