あり、以下を最適化する方法があるが、それはあなたの場合には必要ではないかもしれません。
0:
library(jsonlite)
library(dplyr)
df <- data_frame()
jsonlite::stream_in(file("/tmp/apps.json"), function(x) { df <<- bind_rows(df, filter(x, app=="15b")) })
私はのように見えるファイルを作りましたあなたが得るコードと
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
{"app":"15c","device_carrier":"Verizon Wireless"}
{"app":"15b","device_carrier":"Verizon Wireless"}
{"app":"15a","device_carrier":"Verizon Wireless"}
ラン:
df
## # A tibble: 13 × 2
## app device_carrier
## <chr> <chr>
## 1 15b Verizon Wireless
## 2 15b Verizon Wireless
## 3 15b Verizon Wireless
## 4 15b Verizon Wireless
## 5 15b Verizon Wireless
## 6 15b Verizon Wireless
## 7 15b Verizon Wireless
## 8 15b Verizon Wireless
## 9 15b Verizon Wireless
## 10 15b Verizon Wireless
## 11 15b Verizon Wireless
## 12 15b Verizon Wireless
## 13 15b Verizon Wireless
こんにちはSmasellは、あなたが解析したいJSON、所望の出力の例を提供することができ、あなたは、これまで何を試してみましたか? –
最も堅牢な方法は、すべてを解析してリストをフィルタリングすることです。解析前のフィルタリングは、JSONのフォーマットが潜在的に変わる可能性があるため、はるかに退屈です。 – MrMobster
@MrMobsterええ、今それは!私は質問を編集しました!ファイル全体を解析せずに可能ですか? – Smasell