Sorry, I really didn't want to push anyone to make my work. Sorry if my words sounded like that. I appreciated your help very much. Thank you
D. 2012/12/28 Jeff Newmiller <jdnew...@dcn.davis.ca.us> > It really seems to me that what you ought to be doing is carefully > studying the code provided at the lamages link that you referenced until > you can modify it to do what you want. It really isn't fair for you to ask > people to do your thinking for you. This is the R-help mailing list, not > R-do-my-work-for-me mailing list. > > JSON, like XML, is a far more flexible data format than a data frame. That > means it is up to you to decide what data or relationships you want to > ignore so you can squeeze some useful subset of the information into a data > frame. There is no way to write a do-it-all function that does this for all > cases. Your goals must be part of each extraction function you use, so you > really need to write it yourself. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live > Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > "sp.duccio" <sp.duc...@gmail.com> wrote: > > >Thank you very much, Rui! > > > >The problem with your script is that data is now in a string format, > >while > >I need to obtain a data.frame instead. > >Do you really think that I cannot do anything else with this json data? > >Thank you very much again > > > >Duccio > > > > > >2012/12/27 Rui Barradas <ruipbarra...@sapo.pt> > > > >> Hello, > >> > >> Your dataset is not in tabular form, so I find it difficult to > >transform > >> it into a data.frame, but you can see it in R with the following. > >> > >> > >> install.packages("RJSONIO", dependencies = TRUE) > >> library(RJSONIO) > >> > >> url <- > >> > >" > http://apistat.istat.it/?q=getdatajson&dataset=DCIS_POPSTRBIL&dim=1,0,0,0&lang=1&tr=&te= > "< > http://apistat.istat.it/?q=getdatajson&dataset=DCIS_POPSTRBIL&dim=1,0,0,0&lang=1&tr=&te= > > > >> dat <- fromJSON(url) > >> > >> str(dat) # List with 3 components > >> > >> str(dat[[1]][[1]]) > >> dat[[1]][[1]] > >> > >> str(dat[[1]][[2]]) > >> unlist(dat[[1]][[2]]) > >> > >> str(dat[[1]][[3]]) > >> dat[[1]][[3]] > >> > >> > >> Hope this helps, > >> > >> Rui Barradas > >> Em 27-12-2012 11:55, sp.duccio escreveu: > >> > >> Hello to everybody, > >> > >> I need to convert a json dataset in an R dataframe. > >> I suppose that I'd need to use rjson or rjsonio package. > >> The json dataset > >is: > http://apistat.istat.it/?q=getdatajson&dataset=DCIS_POPSTRBIL&dim=1,0,0,0&lang=1&tr=&te= > >> It would be nice if someone can help me to create a function like the > >one > >> > >below: > http://lamages.blogspot.it/2011/09/accessing-and-plotting-world-bank-data.html > >> that can applied to my json dataset and with all the parameter values > >that > >> can be specifiable. > >> Is there anyone who can solve this problem? > >> > >> Thanx in advance for any help! > >> Duccio > >> > >> > >> > >> > >> ______________________________________________r-h...@r-project.org > >mailing listhttps://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. > >> > >> > >> > > -- Il messaggio trasmesso può contenere informazioni di carattere confidenziale rivolte esclusivamente al destinatario. Ne è vietato l'uso, la diffusione, la distribuzione o la riproduzione da parte di altre persone e/o entità diverse da quelle specificate. Nel caso aveste ricevuto questo messaggio per errore siete pregati di segnalarlo immediatamente al mittente e cancellare quanto ricevuto. This electronic mail transmission may contain confidential information addressed only to the person (s) named. Any use, distribution, copying or disclosure by any other person and/or entities other than the intended recipient is prohibited. If you received this transmission in error, please inform the sender immediately and delete the material. [[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.