similar to: plot.zoo warnings - ignore or look for problem?

Displaying 20 results from an estimated 8000 matches similar to: "plot.zoo warnings - ignore or look for problem?"

2005 Nov 16
1
COM dates (was origin and "origin<-" in chron)
I was just looking for an easy way to convert between COM datetime and chron datetime (both ways.) I found examples on the list, but they involved origin. Does anyone have functions for converting COM datetime <-> chron datetimethat work "safely"? David L. Reiner > -----Original Message----- > From: Gabor Grothendieck [mailto:ggrothendieck@gmail.com] >
2005 Nov 15
1
origin and "origin<-" functions on chron
I'm trying to use/modify some code I found (at Omegahat, but I've seem similar usage elsewhere.) It contains the lines: if(any(origin(chronDate)!=orig)) origin(chronDate) <- orig Let's say: > require("chron") [1] TRUE > chronDate <- chron("11/15/2005", format="m/d/y", origin.=c(12,31,1899)) > orig <- c(month=12, day=31,
2006 Jul 24
3
unique, but keep LAST occurence
?unique says Value: An object of the same type of 'x'. but if an element is equal to one with a smaller index, it is removed. However, I need to keep the one with the LARGEST index. Can someone please show me the light? I thought about reversing the row order twice, but I couldn't get it to work right (My data frame has 125000 rows and 7 columns, and I'm
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)
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 Jul 06
1
pretty for date-time?
pretty() works well for numbers and axTicks() can help for potting log axes, but has anyone written a pretty for chron objects (or other date or date-time classes)? It would have natural units of years, months, .., days, hours, (minutes?), and it would choose the appropriate unit based on the date(time) range. I have searched the archives and documentation to no avail. (I wrote one of these back
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)
2005 Jul 19
2
Problems with date-format (R 2.1.1 + chron)
Hello, today I've updated on the newest R-Version. But sadly a function I needed didnt want to work: The input is e.g. days(as.Date("21-07-2005","%d-%m-%y")) the error is: Fehler in Math.Date(dts): floor nicht definiert f??r Date Objekte (Error in Math.Date(dts): floor not defined for date objects) Same for year. Only months gives me the correct output. In Version
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
2007 Dec 16
2
question about the aggregate function with respect to order of levels of grouping elements
Hi, I am using aggregate() to add up groups of data according to year and month. It seems that the function aggregate() automatically sorts the levels of factors of the grouping elements, even if the order of the levels of factors is supplied. I am wondering if this is a bug, or if I missed something important. Below is an example that shows what I mean. Does anyone know if this is just the way
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
2000 Jul 12
1
plot.times error -- missing or illegal tck parameter (PR#601)
There seems no default setting for tck, causing problems for plot.times() > library(chron) > dts <- dates(c("02/27/92", "02/27/92", "01/14/92", + "02/28/92", "02/01/92")) > y<-chron(dts,out.format=c("dmy","h:m:s")) > y [1] 270292 270292 140192 280292 010292 > plot(y,1:5) Error in axis(n, at =
2007 Dec 13
1
counting weekday in a month in R
Hi, I am trying to count weekday of the month using R. For example, 1/4/2001 is the 4th weekday of Jan, and 1/5/2001 is the 5th weekday of the month, and 1/8/2001 is the 6th weekday of the month, etc. I get as far as extracting the weekdays from a sequence of dates (see below). But I have not yet figured out a fast way of counting without using a For Loop. Does anyone know how to do such counting
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 May 06
4
Choices from a matrix
Could someone please suggest a more clever solution to the following problem than my loop below? Given X a 2xN matrix X, and I a k-subset of N, Generate the (2^k)xN matrix Y with columns not in I all zero and the other columns with all choices of an entry from the first or second row of X. For example, with X <- matrix(1:8, nrow=2) I <- c(1,3) X is 1 3 5 7 2 4 6 8 and Y should be 1 0 5
2004 Sep 13
2
Can I find the datetime an object was last assigned to/saved?
I'm using v 1.9.1 under Windoz XP. Can I do the equivalent of "ls -l" on my R objects? R's "ls()" lists only the names. Thanks! David L. Reiner Rho Trading 440 S. LaSalle St -- Suite 620 Chicago IL 60605 312-362-4963 (voice) 312-362-4941 (fax) [[alternative HTML version deleted]]
2004 Nov 08
1
can one evaluate an expression in a comment? (or insert resultsinto history?)
But that doesn't put the result into the history buffer, to be written to a file only later when I savehistory(filename). Bert Gunter also suggested ?capture.output and ?textConnection, but I cannot see how to get text into the history buffer as comments, but with evaluated expressions (values). I know how to use paste, sink, write, etc. but nothing that I can see inserts into the history
2006 Jun 15
2
Standard Deviation Distribution
I'm having trouble with the standard deviation distribution as shown on http://mathworld.wolfram.com/StandardDeviationDistribution.html . (Eric Weisstein references Kenney and Keeping 1951, which I can't check.) I believe the graphs they show, but when I code the function in R, according to the listed formula, I get very different graphs. Would someone please point out my error or tell
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
2004 Sep 29
2
How to print landscape from script in Windows: dev.print(win.print, printer="local printer name", ...) does not accept horizontal=TRUE
This is a windows-specific question. After generating a plot, I can print from scripts or the command line with > dev.print(win.print,printer="local windows printer name") I would like to print in landscape mode. From the menus, I can accomplish this by changing the properties of the printer before clicking "print". However, I tried adding