CRAN Package Check Results for Package RJSONIO

Last updated on 2024-03-28 23:55:18 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.3-1.9 18.45 45.03 63.48 OK
r-devel-linux-x86_64-debian-gcc 1.3-1.9 16.10 36.11 52.21 OK
r-devel-linux-x86_64-fedora-clang 1.3-1.9 103.08 OK
r-devel-linux-x86_64-fedora-gcc 1.3-1.9 88.95 OK
r-devel-windows-x86_64 1.3-1.9 31.00 2040.00 2071.00 ERROR
r-patched-linux-x86_64 1.3-1.9 20.05 44.74 64.79 OK
r-release-linux-x86_64 1.3-1.9 19.57 43.66 63.23 OK
r-release-macos-arm64 1.3-1.9 40.00 OK
r-release-macos-x86_64 1.3-1.9 76.00 OK
r-release-windows-x86_64 1.3-1.9 37.00 77.00 114.00 OK
r-oldrel-macos-arm64 1.3-1.9 40.00 OK
r-oldrel-windows-x86_64 1.3-1.9 31.00 87.00 118.00 OK

Check Details

Version: 1.3-1.9
Check: tests
Result: ERROR Running 'array.R' [169s] Running 'bigInt.R' [157s] Running 'charNULL.R' [0s] Running 'con1.R' [1s] Running 'con2.R' [156s] Running 'containers.R' [170s] Running 'empty.R' [0s] Running 'encoding.R' [167s] Running 'exp.R' [163s] Running 'keys.R' [166s] Running 'performance.R' [157s] Running 'prealloc.R' [167s] Running 's4.R' [0s] Running 'scalarCollapse.R' [0s] Running 'serialize.R' [0s] Running 'simple.R' [165s] Running 'simplify.R' [0s] Running 'stringFun.R' [0s] Running 'toJSON.R' [171s] Running 'utf8.R' [168s] Running the tests in 'tests/array.R' failed. Complete output: > library(RJSONIO) > a = array(1:(5*7*9), c(5, 7, 9)) > o = toJSON(a) > isValidJSON(I(o)) [1] TRUE > b = fromJSON(I(o)) > > toJSON(table(1:3)) [1] "[\n1, 1, 1\n]" > toJSON(table(1:3, 1:3)) [1] "[ {\n \"1\": 1,\n \"2\": 0,\n \"3\": 0 \n },\n{\n \"1\": 0,\n \"2\": 1,\n \"3\": 0 \n },\n{\n \"1\": 0,\n \"2\": 0,\n \"3\": 1 \n } ]" > > #z = apply(a, 3, function(x, dim) toJSON(x)) > #toJSON(array(1:8,c(2,2,2))) > > proc.time() user system elapsed 0.17 0.07 0.25 Running the tests in 'tests/bigInt.R' failed. Complete output: > library(RJSONIO) > i = fromJSON("[123]")[[1]] > is.integer(i) [1] FALSE > i == 123L [1] TRUE > > > x = fromJSON("[12345678901]")[[1]] > is.numeric(x[[1]]) [1] TRUE > x == 12345678901 [1] TRUE > > x = fromJSON("[-12345678901]")[[1]] > is.numeric(x[[1]]) [1] TRUE > x == -12345678901 [1] TRUE > > > > proc.time() user system elapsed 0.23 0.03 0.25 Running the tests in 'tests/con2.R' failed. Complete output: > library(RJSONIO) > con = textConnection("[1, 2, 3,\n4]"); fromJSON(con) [1] 1 2 3 4 > > try({con = textConnection("[1, 2, 3,]"); fromJSON(con)}) [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 [[4]] NULL > > > proc.time() user system elapsed 0.20 0.03 0.21 Running the tests in 'tests/containers.R' failed. Complete output: > library(RJSONIO) > > roundTrip = + # compare can be all.equal + function(x, y = x, simplify = TRUE, asIs = NA, compare = identical) { + ans <- fromJSON(toJSON(x, asIs = asIs), simplify = simplify) + compare(ans, y) + } > > stopifnot(roundTrip(c(TRUE, FALSE))) > stopifnot(roundTrip(TRUE)) > try(stopifnot(roundTrip(1L))) # fails since 1L becomes a numeric Error : roundTrip(1L) is not TRUE > stopifnot(roundTrip(1)) > stopifnot(roundTrip("xyz")) > > stopifnot(roundTrip(c(TRUE, FALSE))) > stopifnot(roundTrip(1:2, as.numeric(1:2))) > stopifnot(roundTrip(c(1, 2, 3))) > stopifnot(roundTrip(c("abc", "xyz"))) > > # with names > stopifnot(roundTrip(c(a = TRUE))) > stopifnot(roundTrip(c(a = 1))) > stopifnot(roundTrip(c(a = "xyz"))) > stopifnot(roundTrip(c(a = 1L), c(a = 1))) > > > # lists > > stopifnot(roundTrip(list(1L), asIs = FALSE, simplify = FALSE, list(1))) > > # > stopifnot(roundTrip(list(1, 2), asIs = FALSE, simplify = FALSE, list(1, 2))) > stopifnot(roundTrip(list(1, 2), asIs = TRUE, simplify = FALSE, list(list(1), list(2)))) > > stopifnot(roundTrip(list(a= 1, b = 2), asIs = TRUE, simplify = FALSE, list(a = list(1), b = list(2)))) > > > # > tmp = list(a = 1, b = c(1, 2), c = list(1:3, x = c(TRUE, FALSE, FALSE), list(c("a", "b", "c", "d")))) > tmp1 = fromJSON(toJSON(tmp)) > all.equal(tmp, tmp1) [1] TRUE > > roundTrip(tmp, compare = all.equal) [1] TRUE > > proc.time() user system elapsed 0.21 0.09 0.29 Running the tests in 'tests/encoding.R' failed. Complete output: > x = "Open Bar $300 \u5564\u9152\u3001\u6C23\u9152 \u4EFB\u98F2" > print(x) [1] "Open Bar $300 啤酒、氣酒 任飲" > Encoding(x) [1] "UTF-8" > library(RJSONIO) > fromJSON(paste('{"tweet":"', x, '"}', sep = '')) tweet "Open Bar $300 啤酒、氣酒 任飲" > > > > proc.time() user system elapsed 0.18 0.06 0.23 Running the tests in 'tests/exp.R' failed. Complete output: > library(RJSONIO) > ans = fromJSON("[3.14e4, 3.14E4]") > stopifnot(ans[[1]] == ans[[2]]) > > proc.time() user system elapsed 0.15 0.06 0.20 Running the tests in 'tests/keys.R' failed. Complete output: > library(RJSONIO) > > ff = system.file("sampleData", "keys.json", package = "RJSONIO") > print(ff) [1] "D:/RCompile/CRANpkg/lib/4.4/RJSONIO/sampleData/keys.json" > z = paste(readLines(ff), collapse = "\n") > > fromJSON(I(z)) $menu $menu$header [1] "SVG Viewer" $menu$items $menu$items[[1]] id "Open" $menu$items[[2]] id label "OpenNew" "Open New" $menu$items[[3]] NULL $menu$items[[4]] id label "ZoomIn" "Zoom In" $menu$items[[5]] id label "ZoomOut" "Zoom Out" $menu$items[[6]] id label "OriginalView" "Original View" $menu$items[[7]] NULL $menu$items[[8]] id "Quality" $menu$items[[9]] id "Pause" $menu$items[[10]] id "Mute" $menu$items[[11]] NULL $menu$items[[12]] id label "Find" "Find..." $menu$items[[13]] id label "FindAgain" "Find Again" $menu$items[[14]] id "Copy" $menu$items[[15]] id label "CopyAgain" "Copy Again" $menu$items[[16]] id label "CopySVG" "Copy SVG" $menu$items[[17]] id label "ViewSVG" "View SVG" $menu$items[[18]] id label "ViewSource" "View Source" $menu$items[[19]] id label "SaveAs" "Save As" $menu$items[[20]] NULL $menu$items[[21]] id "Help" $menu$items[[22]] id label "About" "About Adobe CVG Viewer..." > > fromJSON(ff, function(type, val) { cat(names(type), "\n"); TRUE}) OBJECT_BEGIN KEY OBJECT_BEGIN KEY STRING KEY ARRAY_BEGIN OBJECT_BEGIN KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END NULL OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END NULL OBJECT_BEGIN KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING OBJECT_END NULL OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END NULL OBJECT_BEGIN KEY STRING OBJECT_END OBJECT_BEGIN KEY STRING KEY STRING OBJECT_END ARRAY_END OBJECT_END OBJECT_END NULL > > > proc.time() user system elapsed 0.23 0.04 0.25 Running the tests in 'tests/performance.R' failed. Complete output: > if(FALSE) { # This works but takes a lot of time. So leave this out + # for default runs. + library(RJSONIO) + + v = rpois(100000, 4) + x = toJSON(v) + + # 0.054 seconds + system.time({ val = fromJSON(x, getNativeSymbolInfo("R_json_IntegerArrayCallback"), + data = rep(as.integer(NA), 100000))}) + + all(v == val) + + # 89.981 So a factor of 1666 + system.time({v1 = fromJSON(x)}) + + + # Now if we preallocate a vector with the size of the result + # and fill it with an R callback, we get 1.050. + # This is a factor of 20 relative to the specialized C code. + gen = + function(n = 100000, ans = integer(n)) + { + pos = 1 + update = + function(type, val) { + if(type == JSON_T_INTEGER) { + ans[pos] <<- val + pos <<- pos + 1 + } + TRUE + } + list(update = update, value = function() ans) + } + h = gen() + system.time({v1 = fromJSON(x, h$update)}) + + + # Now let's use the generic list + # We get 1.130 + + gen.list = + function(n = 100000, ans = vector("list", n)) + { + pos = 1 + update = + function(type, val) { + if(type == JSON_T_INTEGER) { + ans[pos] <<- val + pos <<- pos + 1 + } + TRUE + } + structure(list(update = update, value = function() unlist(ans[1:pos])), + class = "JSONParserHandler") + } + h = gen.list() + system.time({v1 = fromJSON(x, h)}) + + + # + gen.list = + function(n = 100000, ans = vector("list", n)) + { + pos = 1 + update = + function(type, val) { + if(type == JSON_T_INTEGER) { + if(length(ans) == pos) + length(ans) <<- 2*pos + ans[pos] <<- val + pos <<- pos + 1 + } + TRUE + } + structure(list(update = update, value = function() unlist(ans[1:pos])), + class = "JSONParserHandler") + } + h = gen.list() + system.time({v1 = fromJSON(x, h)}) + + + + ############################################ + + v = rpois(100000, 4) + x = toJSON(v) + + h = RJSONIO:::simpleJSONHandler() + system.time({a = fromJSON(x, h)}) + # user system elapsed + # 59.470 21.693 91.442 + system.time({a = fromJSON(x)}) + # user system elapsed + # 3.899 0.117 4.415 + system.time({a = fromJSON(x, default.size = 10000)}) + # user system elapsed + # 3.957 0.116 4.465 + system.time({a = fromJSON(x, default.size = 100000)}) + } > > proc.time() user system elapsed 0.12 0.07 0.18 Running the tests in 'tests/prealloc.R' failed. Complete output: > f = "inst/sampleData/usaPolygons.as" > > # The idea here is to customize the reading by pre-allocating space. > readArray = + function(type, val) { + # if(type) + } > > # fromJSON(f, ) > > proc.time() user system elapsed 0.15 0.04 0.17 Running the tests in 'tests/simple.R' failed. Complete output: > library(RJSONIO) > x = "[1, 3, 10, 19]" > fromJSON(I(x)) [1] 1 3 10 19 > > h = RJSONIO:::basicJSONHandler() > fromJSON(x, h$update) NULL > > if(!(fromJSON(I("[3.1415]")) == 3.1415)) + stop("Failed for doubles") > > > # From couchdb > > x = '{"total_rows":3,"offset":0,"rows":[{"id":"abc","key":"xyz","value":{"rev":"1-3980939464"}},{"id":"x123","key":"x123","value":{"rev":"1-1794908527"}}]}\n' > > fromJSON(x) $total_rows [1] 3 $offset [1] 0 $rows $rows[[1]] $rows[[1]]$id [1] "abc" $rows[[1]]$key [1] "xyz" $rows[[1]]$value rev "1-3980939464" $rows[[2]] $rows[[2]]$id [1] "x123" $rows[[2]]$key [1] "x123" $rows[[2]]$value rev "1-1794908527" > > > > > > > > > > > proc.time() user system elapsed 0.20 0.07 0.26 Running the tests in 'tests/toJSON.R' failed. Complete output: > library(RJSONIO) > > toJSON(list(1, 2, list(1, NA))) [1] "[\n 1,\n 2,\n[\n 1,\nnull \n] \n]" > > toJSON(list(1, 2, list(NA))) # collapses the sub-list into the main vector. [1] "[\n 1,\n 2,\n[\n null \n] \n]" > > > e = new.env(); e$a = 1:10; e$bc = letters[1:3] > cat(toJSON(e, pretty = TRUE)) { "a" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ], "bc" : [ "a", "b", "c" ] }> > > a = list(x=1, y=character(0)) > fromJSON( toJSON( a ) ) $x [1] 1 $y list() > a = list(x=1, y=character(0), b = 1) > fromJSON( toJSON( a ) ) $x [1] 1 $y list() $b [1] 1 > > > a = list(x = vector(), y = 123, z = "allo") > fromJSON(toJSON(a)) $x list() $y [1] 123 $z [1] "allo" > > > > proc.time() user system elapsed 0.23 0.07 0.29 Running the tests in 'tests/utf8.R' failed. Complete output: > library(RJSONIO) > if(!is.null(getOption('NYTimesAPI'))) { + news = getForm('http://api.nytimes.com/svc/search/v1/article', 'api-key' = getOption('NYTimesAPI')["Article Search"], query = "climate change") + } else + load("newsUTF8.rda") > > fromJSON(news) $offset [1] "0" $results $results[[1]] body "Whenever modern humans reached a new continent in the expansion from their African homeland 50,000 years ago, whether Australia, Europe or the Americas, all the large fauna quickly disappeared. This circumstantial evidence from the fossil record suggests that people&#8217;s first accomplishment upon reaching new territory was to hunt all its all" byline "By NICHOLAS WADE" date "20091124" title "New Data Shed Light on Large-Animal Extinction" url "http://www.nytimes.com/2009/11/24/science/24fauna.html" $results[[2]] body "Perhaps by living on another planet, you might have missed the popular conclusion that Asia must increase consumption and let its exchange rates climb to help put the world economy on a more even keel. But, until recently, another part of the policy prescription for stronger Asian demand to reduce global imbalances has received far less attention:" byline "By ALAN WHEATLEY" date "20091124" title "INSIDE ASIA; Asia Could Benefit From Cooperating on Infrastructure" url "http://www.nytimes.com/2009/11/24/business/global/24inside.html" $results[[3]] body "BRAS&#205;LIA &#151; As leaders from Brazil and Iran prepared to meet here on Monday, the Brazilian president, Luiz Inacio Lula da Silva , defended his decision to play host to the Iranian president at a moment of rising tension over Iran&#8217;s nuclear ambitions. In his national radio show, Mr. da Silva said that &#8220;you don&#8217;t move" byline "By ALEXEI BARRIONUEVO" date "20091124" title "Brazil’s President Defends Visit of Iranian Leader" url "http://www.nytimes.com/2009/11/24/world/americas/24brazil.html" $results[[4]] body "Let&#8217;s stipulate: Lloyd Blankfein and Jamie Dimon are enlightened, broad-gauge chief executive officers, among the finest in the world. Their firms, Goldman Sachs and JPMorgan Chase, are indispensable in raising capital for companies, creating wealth. They&#8217;ve repaid the government assistance money received in the financial crisis and are" byline "By ALBERT R. HUNT" date "20091124" title "LETTER FROM WASHINGTON; No Lessons Learned on Wall Street" url "http://www.nytimes.com/2009/11/24/us/24iht-letter.html" $results[[5]] body "Joe Witte, a meteorologist for News Channel 8 in Virginia and Maryland, hopes that people watching his television forecasts will think about more than just the weather. Two years ago, Mr. Witte started to include phenomena linked with climate change in his reports, like how warmer conditions affect life in Chesapeake Bay and prospects for" byline "By JAMES KANTER" date "20091123" title "GREEN INC. COLUMN; New Voices on Climate Change" url "http://www.nytimes.com/2009/11/23/business/energy-environment/23iht-green23.html" $results[[6]] body "BUSINESS DAY An article on Friday about a House committee&#8217;s approval of a measure that would expand Congressional oversight of the Federal Reserve misidentified the state represented by Paul E. Kanjorski, who offered an amendment that would expand government power over large financial institutions. It is Pennsylvania, not Ohio. ( Go to" date "20091123" title "Corrections" url "http://www.nytimes.com/2009/11/23/pageoneplus/corrections.html" $results[[7]] body "An article on Thursday about turmoil within the United States Chamber of Commerce over its opposition to climate change legislation erroneously included one company among those that have resigned from the chamber over the climate policy. A spokeswoman for Levi Strauss &#38; Company said that although the company had differed with the chamber over" date "20091123" title "Corrections" url "http://www.nytimes.com/2009/11/23/pageoneplus/23corrections-003.html" $results[[8]] body "WASHINGTON &#151; On the House floor during a debate over health care reform , he taunted a colleague who had been calling for his ouster. At a recent fund-raiser, he complained that the House speaker had made an end run around him and his committee. Confronted by a persistent conservative activist in a hallway, he let loose an expletive, telling" byline "By RAYMOND HERNANDEZ and JIM RUTENBERG" date "20091123" title "His Ethics Under Scrutiny, Rangel Is Frayed but Defiant" url "http://www.nytimes.com/2009/11/23/nyregion/23rangel.html" $results[[9]] body "BRAS&#205;LIA &#151; Brazil &#8217;s ambitions to be a more important player on the global diplomatic stage are crashing headlong into the efforts of the United States and other Western powers to rein in Iran &#8217;s nuclear arms program. Luiz In&#225;cio Lula da Silva , Brazil&#8217;s president, is set to receive Iran&#8217;s president, Mahmoud" byline "By ALEXEI BARRIONUEVO" date "20091123" title "Brazil Elbows U.S. on the Diplomatic Stage" url "http://www.nytimes.com/2009/11/23/world/americas/23brazil.html" $results[[10]] body "PORTLAND, Ore. &#151; For decades, the world&#8217;s supercomputers have been the tightly guarded property of universities and governments. But what would happen if regular folks could get their hands on one? The price of supercomputers is dropping quickly, in part because they are often built with the same off-the-shelf parts found in PCs, as a" byline "By ASHLEE VANCE" date "20091123" title "Shared Supercomputing and Everyday Research" url "http://www.nytimes.com/2009/11/23/technology/23compute.html" $tokens [1] "climate" "change" $total [1] 10492 > > proc.time() user system elapsed 0.23 0.06 0.28 Flavor: r-devel-windows-x86_64