similar to: identify time span in date vector

Displaying 20 results from an estimated 30000 matches similar to: "identify time span in date vector"

2012 Jan 27
2
convert sas date format
Hi everybody, i have a csv-file, containing dates in an akward sas format, where 31.12.1559 is -1, 1.1.1960 is 1, 2.1.1960 is 2 and so on (see http://www.sfu.ca/sasdoc/sashtml/lrcon/zenid-63.htm ). Is there any function in R to convert this into YYYY-M-D easily? Best, Felix Dr. rer. nat. Dipl.-Psych. Felix Fischer Institut für Sozialmedizin, Epidemiologie und Gesundheitsökonomie Charité -
2011 Nov 15
2
break error bars in ggplot2
Hello, i use ggplot to plot some measures including CIs as horizontal errorbars. I get an error when the scale limits are narrower than the boundaries of the error bar and hence the CIs are not plotted. library(ggplot2) df <- data.frame(resp=c(1,2), k=c(1,2), se=c(1,2)) ggplot(df, aes(resp,y=k)) + geom_point() + geom_errorbarh(aes(xmax = resp + se, xmin = resp - se)) +
2007 Oct 09
3
identify number of sequences from a vector
? stato filtrato un testo allegato il cui set di caratteri non era indicato... Nome: non disponibile Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071009/365764b4/attachment.pl
2009 Dec 21
1
proposal for new axis.Date/axis.POSIXct
Hi R-devel. I've noticed a couple of quirks in the current time/date axis functions (axis.Date, axis.POSIXct, and the equivalents in lattice). Looking at the code, it seems like a fairly ad-hoc approach, often using pretty() on components of the time. This is not always ideal - for example a one-hour interval gets cut into 10-minute chunks rather than the more natural 15-minute chunks (since
2010 Apr 29
3
control span in panel.loess in xyplot
Dear R gurus.. Is it possible to control span settings for different values of a grouping variable, when using xyplot? an example code shown below d=data.frame(x=rep(sample(1:5,rep=F),10),y=rnorm(50),z=rep(sample(LETTERS[1:2],rep=F),25)) xyplot(y~x,data=d,groups=z,panel=panel.superpose,panel.groups=panel.loess(span=c(2/3, 3/4,1/2)) or something like..
2010 Aug 27
3
interpreting date-related error message
Hello, helpeRs, I have a vector of numbers from 1-365 (days of the year) that I would like to convert to a date. There are no NA's and no missing values. I did not insert leading zero's for numbers less than 100. Using the syntax: dat$doy.1 <- as.numeric(format(dat$doy, "%j" )) I get the following error message: Error in prettyNum(.Internal(format(x, trim, digits,
2010 Apr 29
1
bug in cut.POSIXt(..., breaks = <numeric>) and cut.Date
x <- seq(as.POSIXct("2000-01-01"), by = "days", length = 20) cut(x, breaks = 3) # Error in `levels<-.factor`(`*tmp*`, value = character(0)) : # number of levels differs cut(as.Date(x), breaks = 3) # Error in `levels<-.factor`(`*tmp*`, value = character(0)) : # number of levels differs Index: base/R/datetime.R
2007 Apr 03
2
Strange labels on plot with dates
Hello fellow R people, I don't understand the default behavior of the axis labeling when plotting dates. I would expect something like 2001, 2002 or possibly Jan 01, Jan 02...Jan 06, but instead I only see Jan 01, Jan 01, Jan 01.... See the following example startdate <- strptime("2001-01-01",format="%Y-%m-%d") enddate <-
2005 Jul 28
4
CSV file and date. Dates are read as factors!
I am using read.csv to read a CSV file (produced by saving an Excel file as a CSV file). The columns containing dates are being read as factors. Because of this, I can not compute follow-up time, i.e. Followup<-postDate-preDate. I would appreciate any suggestion that would help me read the dates as dates and thus allow me to calculate follow-up time. Thanks John John Sorkin M.D., Ph.D. Chief,
2012 Jun 21
4
convert 'character' vector containing mixed formats to 'Date'
Dear all I have a 'character' vector containing mixed formats (thanks Excel!) and I'd like to translate it into a default "%Y-%m-%d" Date vector. x <- c("1/3/2005", "13/04/2004", "2/5/2005", "2/5/2005", "7/5/2007", "22/04/2004", "21/04/2005", "20080430", "13/05/2003",
2013 Jan 29
1
starting values in glm(..., family = binomial(link = log))
Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when I set start = coef(logistic_model) within the function call, glm still says it cannot find starting values? This seems to be more of a problem, when I include a
2008 Feb 14
1
{lattice/grid} "Error using packet 1" and traceback
On some errors during the plot of a lattice/grid graphics, there is written a message like "Error using packet 1: missing value where TRUE/FALSE needed" into the concering panel and the next panel is plotted. Which option I could use to stop the execution to have a look at the error by a traceback? Regards - Wolfram
2017 Jul 06
1
Convert date to continuous variable in R
Thanks it worked for me. I wanted to plot days since planting on x-axis 1 and years on x-axis 3. LAI_simulation$Date <- as.Date( LAI_simulation$Date, '%Y/%m/%d') LAI_simulation$Date <- as.integer(LAI_simulation$Date - as.Date("2009-10-07")) plot(LAI~Date,data=LAI_simulation,xlab="Days since Oct, 7,
2001 Oct 10
1
Importing many files
Hello Cracks, we want to import 10 x 365 files containing each 7 variables with 1211 rows. The filenames end with numbers from 1 to 365. We tried a for loop to import using read.table but we couldn't create the r objects within the loop. We want each file in an own r-objekt (matrix). Does anyone know what can be done? Thanks, Felix -- Felix Tiefenbacher Eidg. Institut f?r Schnee- und
2011 Jul 17
3
How to convert number (matlab) to date
Hello I am new to R and I need to convert some dates (numeric format by matlab) to actual dates in R. For instance, Matlab -> 730456 -> >> datestr(730456) ans = 02-Dec-1999 R - > library(zoo) > as.Date(730456) [1] "3969-12-03" I don't not mind the output format but it needs to be right. Many thanks Ed
2010 Aug 20
3
Date Inconsistencies? Buglets?
The treatment of dates seems to be a little inconsistent in R 2.11.1 (2010-05-31): [1] The choice of origins? > as.integer(as.Date("1970-01-01")) works and assumes as origin 1970-01-01. However, > as.Date(1) does not work. It requires an origin (as.Date(1, origin="1970-01-01")). If we set a default origin in the former, it should probably work when the input
2011 Mar 17
3
date conversion
Dear R People: I have a monthly time series which runs from January 1998 to December 2010. When I use tsp I get the following: > tsp(ibm$ts) [1] 1998.000 2010.917 12.000 Is there an easy way to convert this to a seq.Date object, please? I would like to have something to the effect of 1998/01/01 .... 2010/12/01 Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer
2010 Dec 10
2
Remove 100 years from a date object
Hello, I have some data that has dates in the form 27.02.37. I convert them to a date object as follows: as.Date(data$date,format="%d.%m.%y") But this gives me years such as 2037 when I would like them to be 1937. I thought of trying to take off some time i.e. as.Date(camCD$DoB,format="%d.%m.%y") - 100*365 But that doesn't seem to work out correctly. Any ideas how to
2006 Mar 14
2
Date problem
Hello, I have some "stupid" problems managing "date" data. I have a colomn "date", which I converted from a character representation: for example: a="26/02/06" date=strptime(a,format="%d/%m/%y") For one part of the analysis, I'm interested only in the month and the year, so I did: m.y=strftime(date,format="%m/%y") This returns me
2003 Sep 15
2
POSIX and identify
Dear Friends, I'm using winXP and R 1.7.1 and plotting some data using dates on the x-axis, and wanted to use identify to show some points but was told by identify that the x and y vectors producing a fine graph with 84 points were not equal in length. Below are the Dato for date - and length(Dato) finds 9 but str finds 84 as known. Will identify not work in this context ? Best wishes