Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用purrr或rlist从json文件中查找元素_R_Json_Purrr - Fatal编程技术网

使用purrr或rlist从json文件中查找元素

使用purrr或rlist从json文件中查找元素,r,json,purrr,R,Json,Purrr,我有一个具有很深层次结构的JSON文件(例如) #读取数据 图书馆(jsonlite) m库(data.tree) x[[1]] #>级别名称 #> 1 2 #>2°--儿童 #> 3 ¦--1 #>4°--儿童 #> 5 ¦ °--1 #>6°--儿童 #> 7 ¦

我有一个具有很深层次结构的JSON文件(例如)

#读取数据
图书馆(jsonlite)
m
库(data.tree)
x[[1]]
#>级别名称
#> 1  2                                   
#>2°--儿童
#> 3       ¦--1                           
#>4°--儿童
#> 5       ¦       °--1                   
#>6°--儿童
#> 7       ¦               °--1           
#>8Ω--X
#>9α-Y
#>10°--儿童
#> 11      °--2                           
#>12°--儿童
#> 13              °--1                   
#>14°--儿童
#> 
#> [[2]]
#>级别名称
#> 1 1                   
#>2°--儿童
#> 3      °--1           
#>4Ω--X
#>5Ω-Y
#>6°--儿童
res[[1]]
#> {
#>“$type”:“Models.Functions.PhaseLookup,Models”,
#>“启用”:正确,
#>“IncludeInDocumentation”:正确,
#>“名称”:“潜在分支机构”,
#>“只读”:错误,
#>“儿童”:{
#>         "1": {
#>“$type”:“Models.Functions.PhaseLookupValue,Models”,
#>             ....
#>        
#>….(为清晰起见,输出被截断)
#> 
#> [[2]]
#> {
#>“$type”:“Models.Functions.LinearInterpolationFunction,Models”,
#>“启用”:正确,
#>“IncludeInDocumentation”:正确,
#>“名称”:“潜在分支机构”,
#>“只读”:错误,
#>“XProperty”:“[Structure].leaftipsaped”,
#>“儿童”:{
#>         "1": {
#>“$type”:“Models.Functions.XYPairs,Models”,
#>“启用”:正确,
#>“IncludeInDocumentation”:正确,
#>“名称”:“XYPairs”,
#>“只读”:错误,
#>“X”:{
#>                 "1": 1,
#>                 "2": 2,
#>                 "3": 3,
#>                 "4": 4,
#>                 "5": 5,
#>                 "6": 6,
#>                 "7": 7,
#>                 "8": 8
#>             },
#>“Y”:{
#>                 "1": 0,
#>                 "2": 0,
#>                 "3": 1,
#>                 "4": 2,
#>                 "5": 4,
#>                 "6": 7,
#>                 "7": 12,
#>                 "8": 20
#>             },
#>“儿童”:[
#> 
#>             ]
#>         }
#>     }
#> }
#> 
由(v0.2.1)库(curl)于2019-02-21创建 图书馆(jqr) url% jq(“..|选择(.Name?==”潜在分支机构”)) #> [ #> { #>“$type”:“Models.Functions.PhaseLookup,Models”, #>“名称”:“潜在分支机构”, #>“儿童”:[ #> { #>“$type”:“Models.Functions.PhaseLookupValue,Models”, #>“开始”:“出现”, #>“结束”:“TerminalSpikelet”, #>“名称”:“植物人”, #>“儿童”:[ #> { #>“$type”:“Models.Functions.LinearInterpolationFunction,Models”, #>“XProperty”:“[Structure].leaftipsaped”, #>“名称”:“潜在分支机构”, #>“儿童”:[ #> { #>“$type”:“Models.Functions.XYPairs,Models”, #>“X”:[ #> 1, #> 2, #> 3, #> 4, #> 5, #> 6, #> 7, #> 8 #> ], #>“Y”:[ #> 0, #> 0, #> 1, #> 2, #> 4, #> 7, #> 12, #> 20 #> ], #>“名称”:“XYPairs”, #>“儿童”:[ #> #> ], #>“IncludeInDocumentation”:正确, #>“启用”:正确, #>“只读”:false #> } #> ], #>“IncludeInDocumentation”:正确, #>“启用”:正确, #>“只读”:false #> } #> ], #>“IncludeInDocumentation”:正确, #>“启用”:正确, #>“只读”:false #> }, #> { #>“$type”:“Models.Functions.PhaseLookupValue,Models”, #>“开始”:“TerminalSpikelet”, #>“结束”:“收获成熟”, #>“姓名”:“生殖”, #>“儿童”:[ #> { #>“$type”:“Models.Functions.Constant,Models”, #>“FixedValue”:0, #>“单位”:空, #>“名称”:“零”, #>“儿童”:[ #> #> ], #>“IncludeInDocumentation”:正确, #>“启用”:正确, #>“只读”:false #> } #> ], #>“IncludeInDocumentation”:正确, #>“启用”:正确, #>“只读”:false #> } #> ], #>“包括内部文件”:
{
    "$type": "Models.Functions.PhaseLookup, Models",
     "Name": "PotentialBranchingRate",
     "Children": [...]
}