similar to: r help date format changes with c() vs. rbind()

Displaying 20 results from an estimated 10000 matches similar to: "r help date format changes with c() vs. rbind()"

2009 May 26
2
Problem with fractional seconds
Dear List, I am having problems converting a file with fractional seconds to class POSIXct. I have set my options to include digits.secs and my format to just time, but my output is the current date with my time lacking the fractions of a second. For example: options(digits.secs=3) t<-c("06:00:00.100","06:00:01.231") myt<-as.POSIXct(t,format="%H:%M:%S")
2009 May 22
5
Need a faster function to replace missing data
Dear List, I need some help in coming up with a function that will take two data sets, determine if a value is missing in one, find a value in the second that was taken at about the same time, and substitute the second value in for where the first should have been. My problem is from a fish tracking study. We put acoustic tags in fish and track them for several days. Location data is supposed
2009 Jul 24
3
Duplicated date values aren't duplicates
Dear list, I just had a function (as.ltraj in Adehabitat) give me the following error: "Error in as.ltraj(xy, id, date = da) : non unique dates for a given burst" I checked my dates and got the following: > dupes<-mydata$DateTime[duplicated(mydata$DateTime)] > dupes [1] (07/30/02 00:00:00) (08/06/03 17:45:00) Is there a reason different dates would come up as duplicate
2009 Aug 13
3
Finding minimum of time subset
Dear List, I have a data frame of data taken every few seconds. I would like to subset the data to retain only the data taken on the quarter hour, and as close to the quarter hour as possible. So far I have figured out how to subset the data to the quarter hour, but not how to keep only the minimum time for each quarter hour. For example:
2011 Jul 29
5
coordinates from locator function in POSIXct format
Dear R-list, I have a plot with y-axis corresponding to wind measurments and x-axis with date-time information. When I want to identify some extrem wind events in the wind-curve, I use locator() to get the exact date-information, by clicking in the points in graph I?m interested in. I get in the R console the x and y coordinates. The x coordinates are not in a POSIXct format, I guess R is
2008 Jan 03
2
retaining formatting when converting a vector to a matrix/data.frame?
Please see example code below. I have a vector ("mydata") of length 10. "mydata" can have various formats (e.g. numeric, text, POSIXct, etc) I use the matrix and data.frame functions to convert "mydata" to a dataframe ("mydf") of 2 columns and 5 rows. What is a "good" way to ensure that the format is retained when I create the
2009 Oct 09
4
Satellite ocean color palette?
Dear List, Is there a color palette avaliable similar to what is used in satellite ocean color imagery? I.e. a gradient with blue on one end and red on the other, with yellow in the middle? I have tried topo.colors(n) but that comes out more yellow on the end. I am looking for something similar to what is found on the CoastWatch web page:
2009 May 26
4
Creating multiple graphs based on one variable
Dear List, I would like to create several graphs of similar data. I have x and y values for several different individuals (in this case fish). I would like to plot the x and y values for each fish separately. I can do it using a for loop, but I think I should be using "apply". Please let me know what I am doing wrong, or if there is a "better" way to do this. What I have
2010 Oct 11
2
(no subject)
Dear List, I am trying to plot date vs. time, but am having problems getting my y-axis labels how I want them.? When left on its own R plots time at 6 hour intervals from 03:00 to 23:00.? I am wanting 6 hour intervals from 2:00 to 22:00.? I realize yaxp doesn't work in plot(), so I am trying to get it to work in par().? However, now I get the ticks where I want them but the time is output
2009 Sep 28
2
Data formatting for matplot
Dear List, I am wanting to produce a multiple line plot, and know I can do it with matplot but can't get my data in the format I need. I have a dataframe with three columns; individuals ID, x, and y. I have tried split() but it gives me a list of matrices, which is closer but not quite what I need. For example: id<-rep(seq(1,5,1),length.out=100) x<-rnorm(100,5,1)
2013 Jan 11
1
Date time conversion bug (as.POSIXct)?
There is something wrong, I think, with the date-time conversion from a numeric value if you use Central European Time (CET) as timezone. Examples from R: If I use the GMT time zone it is OK, I get the same time back from as.POSIXct as I entered > as.POSIXct(as.numeric(strptime("30/01/2012 13:00:00", format="%d/%m/%Y >
2003 Mar 06
1
Timezones
Can anybody give me a hint why as.POSIXlt doesn't recognize the same timezones that zdump knows about (Linux Suse 8.1 and Suse 7.3)? Is there a workaround? R : Copyright 2002, The R Development Core Team Version 1.6.1 (2002-11-01) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for
2007 Sep 27
3
testing the contents of an environment
Suppose I want to delete everything in my working directory that is not a function. It seems that sapply(ls(),is.function) always returns FALSE, because ls() returns objects of mode character. How do I evaluate is.function(), not on a character string, but on the object that character string represents? Thanks, Tim
2009 May 21
2
help with gsub and date pattern
Dear List, I am having a problem using gsub to remove dates from a date/time string. For example: x<-c("5/31/2009 12:34:00","6/1/2009 1:14:00") I would like to remove the date and have just the time. I have tried: gsub("[0-9+]/[0-9+]/[0-9+]","",x) and various versions. I think my problem is that the / is a special character and is telling it
2011 Oct 05
2
any way to convert back to DateTime class when "accidental" conversion to numeric?
Hi, In short, I would like to know if there is any way to convert a numeric into a date, similar to how strptime() can convert a string to a date time class? There are some functions, etc. which don't work well with dates, and tend to force them into numerics. I understand that the number it spits back is the number of seconds since the beginning of 1970 (see the first few sentences
2008 Apr 10
1
ISOdate/ISOdatetime performance suggestions, other date/time questions
Dear list: working with date/times I have come across a problem that ISOdate and ISOdatetime are too slow on large vectors of data. I was surprised just until I looked at the implementation and the man page: "ISOdatetime and ISOdate are convenience wrappers for strptime". In other terms, they convert data to character representation first in order to create a POSIXlt object that is then
2006 Feb 21
3
Number of Days Between Dates: Incorrect Results For Date Calucations.
In some cases, incorrect results are produced by the code below intended to calculate the number of days between 2 dates. The year in question was a leap year. Note the results for 2004-04-04 and 2004-04-05 are the same! They should be 37 and 38 respectively. > as.integer(as.POSIXct("2004-04-02") - as.POSIXct("2004-02-27")) [1] 35 >
2010 Nov 12
1
unexpected behaviour of rbind with dataframe containing POSIXct
Hello list, here is what I stumbled upon: 1> test <- data.frame(time=as.POSIXct((1:2),origin="2000-1-1")) 1> test time 1 2000-01-01 00:00:01 2 2000-01-01 00:00:02 1> rbind(test,b=1:2) Fehler in as.POSIXct.numeric(value) : 'origin' muss angegeben werden When I try to attach an additional row to a dataframe with a row containing dates I get the
2010 May 03
2
Estimating theta for negative binomial model
Dear List, I am trying to do model averaging for a negative binomial model using the package AICcmodavg. I need to use glm() since the package does not accept glm.nb() models. I can get glm() to work if I first run glm.nb and take theta from that model, but is there a simpler way to estimate theta for the glm model? The two models are: mod.nb<-glm.nb(mantas~site,data=mydata)
2004 Mar 03
2
read.spss and time/date information
I don't use SPSS but following through on your detective work can provide the likely answer. First note that both date numbers are evenly divisible by the number of seconds in a day, i.e. 24*60*60. This suggests that these numbers are seconds since some origin. Since we know "2003/02/11" corresponds to 13264300800 we deduce that the origin must be spss.orig <-