0

I trying to import a json into R and plot it as time series..

> json_file = "/Users/stpn/documents/statuses.json"
> json_data <- fromJSON(paste(readLines(json_file), collapse=""))
> json_data[1]
    $`2013-03-10 00:00:52 UTC`
    [1] 1

I am new to R, so kind of not sure where to go from here. I want to just plot this with date as X and numbers as Y. I guess I need to convert this list to something else first and convert strings into Date. I know I can do

> strptime(names(json_data), format="%Y-%m-%d  %H:%M:%S")

But not sure how to get to the plot from here..

Also if there is a way to convert that UTC to ET that would be really great

Stpn
  • 6,202
  • 7
  • 47
  • 94
  • Not sure what the problem is exactly. You can plot it the date just like anything else with the plot() function - what am I missing here? Converting timezones works with POSIXct as described here: http://stackoverflow.com/questions/1395117/how-do-you-convert-dates-times-from-one-time-zone-to-another-in-r – oliver13 Mar 10 '13 at 23:35
  • Can you give more info about json_data? May be paste output of `dput(json_data)` here for us to recreate the data on our side? – CHP Mar 11 '13 at 01:03

0 Answers0