Re: [R] JSON data in data frame

2017-01-14 Thread Rob Baer
Try this: # get weather data library(jsonlite) dat<- fromJSON('http://api.openweathermap.org/data/2.5/group?id=524901,703448,2643743=metric=ec0313a918fa729d4372555ada5fb1f8') tab <- dat$list #look at what we get class(tab) names(tab) ncol(tab) nrow(tab) tab[,c("clouds","wind","name")]

Re: [R] JSON data in data frame

2017-01-14 Thread Archit Soni
Hey David, A big big thank you..!! Your code worked like a charm and with little tweaks i extracted each item from other nested data frames. Now i got a single data frame My final code: dat2 <- cbind(as.data.frame(dat1$list[!names(dat1$list) %in%

Re: [R] JSON data in data frame

2017-01-14 Thread David Winsemius
> On Jan 14, 2017, at 9:27 AM, William Dunlap via R-help > wrote: > > This is a question concerning the interface between the TIBCO products > Spotfire and TERR so most people on this mailing list won't have a > clue. You will have better luck with TIBCO support or

Re: [R] JSON data in data frame

2017-01-14 Thread William Dunlap via R-help
This is a question concerning the interface between the TIBCO products Spotfire and TERR so most people on this mailing list won't have a clue. You will have better luck with TIBCO support or asking in the Q section of https://community.tibco.com. It does sound like you might have a data.frame

Re: [R] JSON data in data frame

2017-01-14 Thread Archit Soni
Hey Rob, Thanks for replying but what i see after i run str(tab$list) is that it has nested data.frame. And for some weird reason Spotfire is discarding and stating as illegal data type. On Jan 14, 2017 20:15, "Rob Baer" wrote: > I just tried after fixing what I thoug were

Re: [R] JSON data in data frame

2017-01-14 Thread Archit Soni
Hi Jermiah, When i ran this code in Spotfire, my aim is to get output as a data table. I am getting the same error: TIBCO Enterprise Runtime for R returned an error: 'Error in .cleanDataForExport(value, output.name) : Output data 'tab$coord' has illegal type: 'data.frame''. Code that I used:

Re: [R] JSON data in data frame

2017-01-13 Thread Archit Soni
Thanks Jeremiah, I'll try this. On Jan 13, 2017 11:23 PM, "jeremiah rounds" wrote: I TAd a course in R computing and the first thing I told students was "inspect. inspect. inspect." d1 <- fromJSON('http://api.openweathermap.org/data/2.5/

Re: [R] JSON data in data frame

2017-01-13 Thread jeremiah rounds
I TAd a course in R computing and the first thing I told students was "inspect. inspect. inspect." d1 <- fromJSON(' http://api.openweathermap.org/data/2.5/group?id=524901,703448,2643743=metric=ec0313a918fa729d4372555ada5fb1f8 ') names(d1) str(d1) d1 d1$list your_data = d1$list On Fri, Jan 13,

[R] JSON data in data frame

2017-01-13 Thread Archit Soni
Hi All, Warm greetings, I am stuck at an issue to convert incoming json response to data frame. I am using below code to get the data library(jsonlite) d1 <- fromJSON(' http://api.openweathermap.org/data/2.5/group?id=524901,703448,2643743=metric=ec0313a918fa729d4372555ada5fb1f8 ') d2 <-