similar to: Problems with date-format (R 2.1.1 + chron)

Displaying 20 results from an estimated 7000 matches similar to: "Problems with date-format (R 2.1.1 + chron)"

2010 May 18
2
Function that is giving me a headache- any help appreciated (automatic read )
note: whole function is below- I am sure I am doing something silly. when I use it like USGS(input="precipitation") it is choking on the precip.1 <- subset(DF, precipitation!="NA") b <- ddply(precip.1$precipitation, .(precip.1$gauge_name), cumsum) DF.precip <- precip.1 DF.precip$precipitation <- b$.data part, but runs fine outside of the function: days=7
2007 Dec 14
3
calculating the number of days from dates
Hello, I gather variants of this question have been asked previously. I have done some reading but only became more confused, as I suspect what I am trying to do is more basic than other applications. The following code readily calculates the difference in days between two dates: newdays <- ISOdate(2005, 5,12) - ISOdate(2006, 12, 22) However, I wanted to be able to deduct the dates in
2011 Aug 30
3
having trouble extracting week from chron object
Running R 2.13.1 on Windows XP. I would like to get week of the year (1-52) for each date. library(chron) dts <- dates(c("02/27/92", "02/27/92", "01/14/92","02/28/92", "02/01/92")) dts dts.chron <- as.chron(dts) dts.chron class(dts.chron) # all of these component extractions work: months(dts.chron) weekdays(dts.chron) years(dts.chron)
2009 Oct 06
1
ggplot2 applying a function based on facet
Look at the bottom of the message for my question #here is a little function that I wrote USGS <- function(input="discharge", days=7){ library(chron) library(gsubfn) #021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS) #02102908 is the Flat Creek Gauge (ftbrfcms) #02133500 is the Drowning Creek (ftbrbmcm) #02341800 is the Upatoi Creek Near Columbus (ftbn) #02342500 is
2005 Feb 11
1
function table
Hi, my problem is the following: I have a large database of insurance-damage data and want to model the frequency of these events. So to fit a distribution on my frequency-data I want to count the number of events in each month via the date of occurrence. Therefor I use this command which works very well: count_table <- table(months(date_occ),years(date_occ)) But there is another
2006 Jun 23
2
problem with hist() for 'times' objects from 'chron' package
Hello dear useRs and wizaRds, I encountered the following problem using the hist() method for the 'times' classes from package 'chron'. You should be able to recreate it using the code: library(chron) # pasted from chron help file (?chron) dts <- dates(c("02/27/92", "02/27/92", "01/14/92", "02/28/92", "02/01/92")) class(dts)
2009 Jul 16
6
Best way to replace :SS with :00
Not sure if there is an R way to do this or a regular express way, but here is what I am trying to do. I've got lots of data where the format is HH:MM:SS, but I need to format it like HH:MM:00, i.e. round the second down to zero. What is the best way to do this? Thanks again. Jason
2001 Jan 11
3
Reformatting dates using chron
Hello All: I am trying to generate a sequence of dates using library(chron). Using the following code, I got most of what I want, dts <- seq.dates("01/02/1998", "01/10/2001", by="day") dts <- dts[!is.weekend(dts)] a sequence of weekdays only (no weekend dates), with first observation appearing as 01/02/98 and the last 01/10/01. But I would
2002 Apr 08
1
Problem(?) in strptime() -- short version
I decided my earlier email on this topic was rather long and wordy; here's a condensed version. I am sitting at a Solaris computer in the US/Pacific timezone. I have a file of data having times that includes the following three values 2002-4-7 1:30:00 GMT 2002-4-7 2:30:00 GMT 2002-4-7 3:30:00 GMT I have not been able to find a way to correctly convert these to either of the POSIX
2005 Jun 09
4
position of a legend-object
Hello, I've written a function that plots a few functions in a diagram. The xlim and or ylim is not always the same, and set automatically by R. A legend is part of this object. Now the problem is: where to put the legend? Me would help a function that returns the limits and scaling of the axis. Thanks for your help. Carsten [[alternative HTML version deleted]]
2005 Feb 02
2
Frequency of Data
Hello, just another problem in R, maybe it's simple to solve for you. I didn't find a solution up to now, but I'm convinced that I'm not the only one who has/had a similar problem. Maybe there's a ready-made function in R? The prob: I've imported a CSV-file into R with 1000 dates of an observed event (there's only information of the date. When there happend no
2005 Feb 25
2
Simulation Progress
Hi, I've made a function that executes a monte-carlo simulation. It always needs a lot of time until e.g. 1Mio simulation steps are done. So I would like to know, how many percent of the work is already done. In an Excel/VBA Solution I could easily implement a status bar or status window. How could an R-Solution look like? Carsten
2005 Jun 29
2
MLE with optim
Hello, I tried to fit a lognormal distribution by using optim. But sadly the output seems to be incorrect. Who can tell me where the "bug" is? test = rlnorm(100,5,3) logL = function(parm, x,...) -sum(log(dlnorm(x,parm,...))) start = list(meanlog=5, sdlog=3) optim(start,logL,x=test)$par Carsten. [[alternative HTML version deleted]]
2005 Jul 12
1
three par. fitting with fitdistr
Hello, I want to fit a tree parameter distribution to given data. I tried it with sample data using the "fitdistr" function. Here my workflow that didn't had any result: I started with the generalized gamma distr, which is: r*dgamma(x^r,shape,rate) The R-function is: ggamma = function (x,r,shape,rate) r*dgamma(x^r,shape,rate=rate) For the first step I assumed r = 1 and I
2008 Nov 06
3
How to manipulate the time data without the date?
Hi,all I only got the time data such as: tms<-c("19:30:23","18:39:10".....) I want to manipulate this time series data. For example, plus one second(or minute) or minus one second This data only has the time(h:m:s), without the date. I know that there are chron package, ISOPix class and the timeDate class, but all these class need the input of date. How can we
2005 Mar 23
2
Browser to replace the internal browser?
Hello, I see that the more I work with R and the more the code gets larger I would like to have some graphic support in my quellcode. Is there a browser that could be easily implemened in R? And how do I call it from R? It would be nice if the browser replaces the "fix()" function. Carsten
2005 Apr 15
2
aggregate slow with variables of type 'dates' - how to solve
Dear all I use aggregate with variables of type numeric and dates. For type numeric functions, such as sum() are very fast, but similar simple functions, such as min() are much slower for the variables of type 'dates'. The difference gets bigger the larger the 'id' var is - but see this sample code: dts <- dates(c("02/27/92", "02/27/92",
2005 Apr 05
1
Fitdistr and likelihood
Hi all, I'm using the function "fitdistr" (library MASS) to fit a distribution to given data. What I have to do further, is getting the log-Likelihood-Value from this estimation. Is there any simple possibility to realize it? Regards, Carsten
2005 Jan 31
2
ML-Fit for truncated distributions
Hello, maybe that my Question is a "beginner"-Question, but up to now, my research didn't bring any useful result. I'm trying to fit a distribution (e.g. lognormal) to a given set of data (ML-Estimation). I KNOW about my data that there is a truncation for all data below a well known threshold. Is there an R-solution for an ML-estimation for this kind of data-problem? As
2006 Jan 12
2
Zaptel SVN
Hi, i can't compile the latest svn update from zaptel: /lib/modules/2.6.14-1.1653_FC4smp/build make -C /lib/modules/2.6.14-1.1653_FC4smp/build SUBDIRS=/usr/src/zaptel modules make[1]: Entering directory `/usr/src/kernels/2.6.14-1.1653_FC4-smp-i686' CC [M] /usr/src/zaptel/zaptel.o /usr/src/zaptel/zaptel.c:6193:5: warning: "CONFIG_ZAPATA_DEBUG" is not defined