Re: [R] R and REST API's
Thanks to all of you who replied. You've provided some great leads. I really appreciate it. Gary On Mon, Sep 28, 2009 at 10:01 AM, Gary Lewis wrote: > Hi - Many organizations now make their data available as XML via a > REST web service architecture. Is there any R package or facility to > access this type of data directly (eg, to make the HTTP GET request > and have the downloaded data put into an R data frame)? > > I used several R search sites to look for an answer, but came up with > very little. Any help would be appreciated. > > Thanks very much. > > Gary Lewis > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R and REST API's
Hi - Many organizations now make their data available as XML via a REST web service architecture. Is there any R package or facility to access this type of data directly (eg, to make the HTTP GET request and have the downloaded data put into an R data frame)? I used several R search sites to look for an answer, but came up with very little. Any help would be appreciated. Thanks very much. Gary Lewis __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] xyplot: superpose 2 time series with different time intervals
Thank you Deepayan. Your suggestion worked perfectly. Thanks too to Gabor for your suggestion and for your help trying to get this help request through to r-help before I subscribed. I'm all set now. Gary On Sat, Aug 1, 2009 at 1:17 PM, Deepayan Sarkar wrote: > On Sat, Aug 1, 2009 at 7:26 AM, Gary Lewis wrote: >> I could use some advice regarding xyplot. >> >> I've got 2 time series. Both cover approximately the same period of >> time (ie, 1940 to 2009). But one series has annual data and the other >> has monthly data. One refers to university enrollment; the other to >> unemployment rates. Both are currently in the same data frame. >> >> I'd like to use the monthly times series as a light grayscale >> background for a plot of the annual time series, showing both series >> as type "l" (line). Naturally with all the NA's in the annual series, >> that plot disappears because points are not connected across missing >> values. > > You could define a small wrapper function that discards NA's before > drawing lines: > > my.panel.lines <- function(x, y, ...) { > keep <- !is.na(y) > panel.lines(x[keep], y[keep], ...) > } > > and use it as a custom panel.groups function: > > xyplot(, > panel = panel.superpose, panel.groups = my.panel.lines) > > -Deepayan > >> I suppose I could make both series annual, but a lot of interesting >> detail would get lost this way. Or I guess I could interpolate values >> in the annual series with monthly approximations, but this means 11 >> out of every 12 values is an approximation. Or I suppose I could plot >> each series separately and then print them with position information, >> which I'm reluctant to do because panel.superpose so nicely handles >> the alignment of the 2 panels. >> >> What I'd really like to do is plot each independently but still >> superposed. Effectively this seems to mean monthly data intervals but >> line connections across the NA's in the series with annual intervals. >> >> Any suggestions would be appreciated. Thanks. >> >> Gary Lewis >> >> __ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] xyplot: superpose 2 time series with different time intervals
I could use some advice regarding xyplot. I've got 2 time series. Both cover approximately the same period of time (ie, 1940 to 2009). But one series has annual data and the other has monthly data. One refers to university enrollment; the other to unemployment rates. Both are currently in the same data frame. I'd like to use the monthly times series as a light grayscale background for a plot of the annual time series, showing both series as type "l" (line). Naturally with all the NA's in the annual series, that plot disappears because points are not connected across missing values. I suppose I could make both series annual, but a lot of interesting detail would get lost this way. Or I guess I could interpolate values in the annual series with monthly approximations, but this means 11 out of every 12 values is an approximation. Or I suppose I could plot each series separately and then print them with position information, which I'm reluctant to do because panel.superpose so nicely handles the alignment of the 2 panels. What I'd really like to do is plot each independently but still superposed. Effectively this seems to mean monthly data intervals but line connections across the NA's in the series with annual intervals. Any suggestions would be appreciated. Thanks. Gary Lewis __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] superpose 2 time series with different time intervals
I could use some advice. I've got 2 time series. Both cover approximately the same period of time (ie, 1940 to 2009). But one series has annual data and the other has monthly data. One refers to university enrollment; the other to unemployment rates. Both are currently in the same data frame. I'd like to use the monthly times series as a light grayscale background for a plot of the annual time series, showing both series as type "l" (line). Naturally with all the NA's in the annual series, that plot disappears because points are not connected across missing values. I suppose I could make both series annual, but a lot of interesting detail would get lost this way. Or I guess I could interpolate values in the annual series with monthly approximations, but this means 11 out of every 12 values is an approximation. Or I suppose I could plot each series separately and then print them with position information, which I'm reluctant to do because panel.superpose so nicely handles the alignment of the 2 panels. What I'd really like to do is plot each independently but still superposed. Effectively this seems to mean monthly data intervals but line connections across the NA's in the series with annual intervals. Any suggestions would be appreciated. Thanks. Gary Lewis __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] possible bug in flexclust
Hi - Writing to see if someone can suggest whether a problem warrants a bug report. It concerns the use of stepFlexclust in the flexclust package. The problem concerns the size of clusters returned. Versions: R-2.7.0 on Windows XP; RODBC_1.2-3 code snippet: r8 <- stepFlexclust(df,8,nrep=100,FUN=kcca, family=kccaFamily("kmedians")) summary(r8) ## returns cluster sizes of 51, 115, 218, 73, 118, 140, 311, and 118 trev <- data.frame([EMAIL PROTECTED]) sqlSave(ch, trev, rownames="unitid") in MySQL: select r8cluster, count(*) from trev group by 1 order by 1 ## returns cluster sizes of 51, 116, 217, 73, 117, 140, 312, 118 problem: 4 of the 8 clusters differ in sizes. They're close but I'd think they should be exact. So ... bug or not a bug? It'd be nice if I was just doing something wrong. Thanks. Gary [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.