GithubHelp home page GithubHelp logo

Comments (4)

jeroen avatar jeroen commented on August 14, 2024

What you're describing seems to be a problem in rstudio viewer. The jsonlite output seems fine:

> data <- fromJSON("http://pastebin.com/raw.php?i=Zw9cP5ri")
> data$status
$id
[1] 125125

$message
[1] "Uploaded our first investor deck - http://braincontrol.me/presentations/bc-deck-01.pdf - see the story behind the HTML5 Bitcoin Wallet"

$created_at
[1] "2014-02-17T12:53:25Z"

Try using str and $ to inspect the data, don't rely on rstudio viewer. The viewer can only show tables.

from jsonlite.

abnova avatar abnova commented on August 14, 2024

I agree - jsonlite seems to convert JSON objects correctly. This is great news! I checked the data as you recommended and it indeed looks fine.

In regard to using RStudio data viewer, I use it only to browse tabular structures - CSV and data frames. Are you saying that the viewer cannot correctly display data frames with embedded data frames (stored by jsonlite as lists)? I thought so initially, but it doesn't seem to be the case: http://stackoverflow.com/questions/22172064/meaning-of-c-in-rstudios-data-browser (see the answer's update).

What is so special about status column that it breaks RStudio data viewer's otherwise correct functionality? Anyway, I'm going to submit an issue report on this problem for RStudio Team.

from jsonlite.

jeroen avatar jeroen commented on August 14, 2024

I'm not an expert on rstudio, but there is no obvious way of displaying nested data in a table-view. Hence it is not surprising that rstudio viewer is incapable of displaying nested data frames.

from jsonlite.

abnova avatar abnova commented on August 14, 2024

Thank you, Jeroen! Just a quick question on jsonlite. If JSON paginated reply contains pages with different number of attributes (columns), would your recommended approach combine them in a result?

getDataPaginated <- function (page) {
  ...
  data <- jsonlite::fromJSON(startupData, simplifyVector = FALSE)
  ...
}

getAngelListData <- function () {
  pages <- 1:getNumPages()
  startups <- lapply(pages, getDataPaginated)
  startups <- do.call(c, startups)
  startups <- jsonlite:::simplify(startups)
  return (startups)
}

from jsonlite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.