Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 1, 8, 4, 3, 2
HI, I'm working with some json files, I have problems to crate my dataframe. Can someone help me?
Here the part of the code with the problem.
Thank you
[> library("rjson")
data_jstor<-fromJSON(file="jstor.jsonl.gz")
head(names(data_jstor))
[1] "creator" "datePublished" "docType" "fullText"
[5] "id" "identifier"
names(data_jstor)
[1] "creator" "datePublished" "docType" "fullText"
[5] "id" "identifier" "isPartOf" "issueNumber"
[9] "language" "outputFormat" "pageCount" "pageEnd"
[13] "pageStart" "pagination" "provider" "publicationYear"
[17] "publisher" "sourceCategory" "tdmCategory" "title"
[21] "url" "volumeNumber" "wordCount" "unigramCount"
[25] "bigramCount" "trigramCount"
data_jstor_df<-as.data.frame(data_jstor) Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 1, 8, 4, 3, 2
head(na.action(data_jstor)) NULL
str(data_jstor) List of 26 $ creator : chr "Fred. Perry Powers" $ datePublished : chr "1900-08-01" $ docType : chr "article" $ fullText : chr [1:8] "552 QUARTERLY JOURNAL OF ECONOMICS THE STOCK OF GOLD IN THE COUNTRY. The amount of gold in the country, as comp"| truncated "NOTES AND MEMORANDA 553 If we eliminate the state banks, we find that the percent- ages of gold and of legal te"| truncated "554 QUARTERLY JOURNAL OF ECONOMICS three years the percentage which each kind of money consti- tuted in the tot"| truncated "NOTES AND MEMORANDA 555 Treasury stated to be in the hands of the people, and the per- centages deposited in 5,"| truncated ... $ id : chr "http://www.jstor.org/stable/1883426" $ identifier :List of 5 ..$ :List of 2 .. ..$ name : chr "issn" .. ..$ value: chr "00335533" ..$ :List of 2 .. ..$ name : chr "oclc" .. ..$ value: chr "35739141" ..$ :List of 2 .. ..$ name : chr "lccn" .. ..$ value: chr "sn97-23017" ..$ :List of 2 .. ..$ name : chr "local_doi" .. ..$ value: chr "10.2307/1883426" ..$ :List of 2 .. ..$ name : chr "journal_id" .. ..$ value: chr "quarjecon" $ isPartOf : chr "The Quarterly Journal of Economics" $ issueNumber : chr "4" $ language : chr "eng" $ outputFormat : chr [1:4] "unigram" "bigram" "trigram" "fullText" $ pageCount : num 8 $ pageEnd : chr "559" $ pageStart : chr "552" $ pagination : chr "pp. 552-559" $ provider : chr "jstor" $ publicationYear: num 1900 $ publisher : chr "Oxford University Press" $ sourceCategory : chr [1:3] "Business & Economics" "Business" "Economics" $ tdmCategory : chr [1:2] "Law - Civil law" "Economics - Economic disciplines" $ title : chr "The Stock of Gold in the Country" $ url : chr "http://www.jstor.org/stable/1883426" $ volumeNumber : chr "14" $ wordCount : num 2827 $ unigramCount :List of 921](url)
library("rjson")
This is a different library, it's not jsonlite.