similar to: Comparing dates in dataframes

Displaying 20 results from an estimated 10000 matches similar to: "Comparing dates in dataframes"

2010 Feb 01
3
merging data frames gives all NAs
Dear kind R helpers, I have a vector of runway names in rwy ("31R", "31L",... the number is user selectable) arrgnd is a data frame with data for all flights and all runways, with a Runway column. I am trying to subset arrgnd into a dat frame for each selected runway, and then combine them back together using the following code: for (j in 1:nr) { # nr = number of
2010 Jan 18
3
Using the output of strsplit
I successfully combined my data frames, and am now on my next hurdle. I had combined the data and quarter, and used tapply to count the entries for each unique date/quarter pair. ar= tapply(ewrgnd$gw, list(ewrgnd$dq), sum) #for each date/quarter combination sums the gw (which are all 1) dq=row.names(ar) spl=strsplit(dq) But I need to split them back into the separate date and quarter. So I used
2009 Feb 26
5
Download daily weather data
I'm writing a program that will tell me whether I should wear a coat, so I'd like to be able to download daily weather forecasts and daily reports of recent past weather conditions. The NOAA has very promising tabular forecasts (http://forecast.weather.gov/MapClick.php?CityName=Ithaca&state=NY&site=BGM&textField1=42.4422&textField2=-76.5002&e=0&FcstType=digital),
2010 Mar 20
3
How to select a row from one dataframe that is "close" to a row in another dataframe
I have two data frames of flight data, but they have very different numbers of rows. They come from different sources, so the data are not identical. > names(oooi) [1] "FltOrigDt" "MkdCrrCd" [3] "MkdFltNbr" "DprtTrpnStnCd" [5] "ArrTrpnStnCd" "ActualOutLocalTimestamp"
2009 Jul 20
2
HELP: BRUGS/WinBUGS/RBUGS Response is a combination of random variables
Hi, Is there anyone know if BUGS language allows the combination of variables as response such as Y[i] <- a*X1[i]+b*X2[i] Y[i] ~ dnorm(c,d) It seems doesn't work in my model. The problem is between two ######. The error message is > modelCheck("BayesBioMarker.BUGS") model is syntactically correct > modelData(paste("BUGS_data.txt",sep="")) data
2010 Feb 02
2
Writing out csv files
In my code, I calculate the maximum values with 2 factors using maxr=with(arrdf, tapply(rate,list(weekday,quarter), max, na.rm=T)) and I want to write out the file so that Excel can read it. I used write.table(maxr, fname, sep=",", col.names=TRUE, row.names=TRUE, quote=TRUE, na="0") which works, and yields something like
2006 Feb 02
2
uninitialized constant
Ok, I searched but couldn''t find anything and I even tried the RoR IRC channel with no help. I get this error: uninitialized constant Airport I used this code which I got from the RoR site. helper :sorting def list @sorter = SortingHelper::Sorter.new self, %w(icao host_id name), @params[''sort''], @params[''order''], ''icao'',
2007 Jul 25
3
aggregate.ts
Consider the following scrap of code: > x<- ts(1:50,start=c(1,11),freq=12) > y <- aggregate(x,nfreq=4) > c(y) [1] 6 15 24 33 42 51 60 69 78 87 96 105 114 123 132 141 > y Error in rep.int("", start.pad) : invalid number of copies in rep.int() > tsp(y) [1] 1.833333 5.583333 4.000000 So we can aggregate into quarters, but we cannot print it using
2007 Jul 25
3
aggregate.ts
Consider the following scrap of code: > x<- ts(1:50,start=c(1,11),freq=12) > y <- aggregate(x,nfreq=4) > c(y) [1] 6 15 24 33 42 51 60 69 78 87 96 105 114 123 132 141 > y Error in rep.int("", start.pad) : invalid number of copies in rep.int() > tsp(y) [1] 1.833333 5.583333 4.000000 So we can aggregate into quarters, but we cannot print it using
2005 Nov 01
1
R Graphs in Powerpoint
I've tried several methods in OS X, and here's what works best for me. Save the R graphic as a PDF file. Open it with Apple's "Preview" application, and save it as a PNG file. The resulting .png file can be inserted into MS Word or PowerPoint, can be resized, and looks good on either OS X or Windows. There are other programs available for translating the pdf file to png
2004 Jan 11
24
More words for Allison
Here's the latest batch of words to get shipped out to Allison Smith. Please submit reasonably small changes to me by tomorrow 10:00 AM Eastern time, and I'll add them. As usual, donations to what will be a ~$110 USD expense would be appreciated, as I am paying for this round out of my pocket. Please send to paypal address "jtodd@loligo.com". I did not include all
2012 May 04
7
Breaking up a Row in R (transpose)
I have the following: Time A1 A1 B1 B1 C1 C2 x y x y x y 0 5 6 6 7 7 9 1 3 4 4 3 9 9 2 5 2 6 4 7 4 I want to change it to the following: 0 1 2 x y x y x y A1 5 6 3 4 5 2 B1
2004 Apr 22
1
Question of Asterisk timer to get Conference work
Hello, Can someone help me. I got zaptel.0.9.1.tar.gz from ftp.asterisk.org, And then I uncomment the line with MODULES # ztdummy, run make clean, make, make install But errors happens as follows: ---------------------------------------------------------- make: zaptel.c:5937: storage size of `zt_fops' isn't known /usr/include/linux/proc_fs.h:193: warning: `create_proc_read_entry'
2009 May 15
1
data summary and some automated t.tests.
I would like to preform a t.test to each of the measured variables (sand.silt etc.) with a mean and sd for each of the treatments (up or down), and out put this as a table.... I am having a hard time starting- maybe it is to close to lunch. Any suggestions would be greatly appreciated. Stephen Sefick x <- (structure(list(sample. = structure(c(1L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 2L, 3L,
2012 Jul 14
2
Arrange two columns into a five variable dataframe
Hi, I hope that folks can give me some simple approaches to taking the data set below, which is accumulated in two columns called "long" and "group", then arrange the data is the "long" column into a data frame containing five variables: "Group 1", "Group 2", "Group 3", "Group 4", and "Group 5". I am hoping for a few
2012 Nov 07
8
Aggregate data frame across columns
Folks, I have a data frame with columns 200401, 200402, ..., 201207, 201208. These represent years/months. What would be the best way to sum these columns by year? What about by quarter? Thanks for your time, KW -- [[alternative HTML version deleted]]
2008 Jan 23
3
How to do more advanced cross tabulation in R?
Hi, I am trying to reproduce some functionalities of Excel pivot table in R, sadly, I couldn't figure out how to do it. I am wondering if this is even possible in R. Does anyone know? Here is an example: year=rep(2003,16) quarter=rep(1:4,each=4) sales=1:16 company=rep(c("a","b","c","d"),4) df=data.frame(year,quarter,sales,company) #this is the
2012 Jul 12
4
Adjusting format of boxplot
Hi, I managed to use the attached data set and figure out the following: flies <- read.table("example12_1.dat",header=TRUE,sep="\t") boxplot(long ~ group, data = flies, horizontal = TRUE, col = "red") I'm very new to R and would like some help with the following: 1. Change the order on the y-axis from 1, 2, 3, 4, 5 to 5, 4, 3, 2, 1.
2012 Jul 24
9
Regular Expression
Hi-- I have three columns in an input file: MONTH QUARTER YEAR 2012-07 2012-3 2012 2001-07 2001-3 2001 2002-01 2002-1 2002 I want to make output like so: MONTH QUARTER YEAR 07 3 2012 07 3 2001 01 1 2002 I was having some trouble getting the regular expression to work. I think it should
2006 Feb 17
3
(Newbie) Functions on vectors
Folks, I want to make the following function more efficient, by vectorizing it: getCriterionDecisionDate <- function (quarter , year) { if (length(quarter) != length(year)) stop ("Quarter and year vectors of unequal length!"); ret <- character(0); for (i in 1:length(quarter)) { currQuarter <- quarter[i]; currYear <- year[i]; if ((currQuarter < 1) |