简体   繁体   中英

Accessing a column from a JSON table using R

I have read a JSON data file named df using fromJSON(). It has a table:

$table$info 
id  OrderNum Tags.store
124 1        Great
125 2        Book
126 5        Nice
125 <NA>     Cool
128 1        <NA> 

I tried df$$table$info$Tags.store but nothing is returned. id and OrderNum works well. Are there any turnabouts?

To get the data.frame:

df$table$info$Tags.store

or to get the column:

df$table$info$Tags.store

If that doesn't work, try getting the data.frame first:

newdf <- df$table$info

and then explore it like so:

names(newdf)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM