- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 tweepy 提取了一些 Twitter 数据,我从那里得到的并不是格式最好的 json,但我不太想出一种不需要花费我几个小时的方法来做到这一点单个文件。 (我在大约 100 个文件中拥有大约 50 万行 Twitter 数据)。
下面附有我的 json 文件的一 (1) 行示例。
Here's a drive link to one of my smaller files if that helps。
从字面上看,任何方法都可以做到这一点,我们将不胜感激。
谢谢!
{"created_at":"Thu Feb 07 10:58:27 +0000 2019","id":1093464000120016896,"id_str":"1093464000120016896","text":"RT @sethia_b: @nparama1951 @RBhamaria @jyotsnavarma9 @JaganNKaushik @DineshA58 @Am_dilip @ashvinn15 @SChakram @Savitritvs @Satishrathod100\u2026","source":"\u003ca href=\"http://twitter.com/download/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":1070710084441784320,"id_str":"1070710084441784320","name":"Kumaran","screen_name":"Kumaran92023000","location":null,"url":null,"description":null,"translator_type":"none","protected":false,"verified":false,"followers_count":222,"friends_count":427,"listed_count":0,"favourites_count":6036,"statuses_count":6834,"created_at":"Thu Dec 06 16:02:31 +0000 2018","utc_offset":null,"time_zone":null,"geo_enabled":false,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"F5F8FA","profile_background_image_url":"","profile_background_image_url_https":"","profile_background_tile":false,"profile_link_color":"1DA1F2","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://pbs.twimg.com/profile_images/1070712098160705542/02c6-KwM_normal.jpg","profile_image_url_https":"https://pbs.twimg.com/profile_images/1070712098160705542/02c6-KwM_normal.jpg","profile_banner_url":"https://pbs.twimg.com/profile_banners/1070710084441784320/1544112886","default_profile":true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Thu Feb 07 09:02:19 +0000 2019","id":1093434772070658048,"id_str":"1093434772070658048","text":"@nparama1951 @RBhamaria @jyotsnavarma9 @JaganNKaushik @DineshA58 @Am_dilip @ashvinn15 @SChakram @Savitritvs\u2026 https://t.co/lfjAiatkbP","display_text_range":[117,140],"source":"\u003ca href=\"http://twitter.com/download/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c/a\u003e","truncated":true,"in_reply_to_status_id":1093433827501006848,"in_reply_to_status_id_str":"1093433827501006848","in_reply_to_user_id":2783847553,"in_reply_to_user_id_str":"2783847553","in_reply_to_screen_name":"nparama1951","user":{"id":796185239370379264,"id_str":"796185239370379264","name":"B.Sethia","screen_name":"sethia_b","location":null,"url":null,"description":"Nation First: Followed by Hollywood Celebrity Paris Hilton, NSitharamanOffice Dr UditRaj MP :\n Views - Contrarian :\n\nFollow Back\nRT not endorsement","translator_type":"none","protected":false,"verified":false,"followers_count":3237,"friends_count":2315,"listed_count":8,"favourites_count":71196,"statuses_count":56458,"created_at":"Wed Nov 09 02:58:48 +0000 2016","utc_offset":null,"time_zone":null,"geo_enabled":true,"lang":"en","contributors_enabled":false,"is_translator":false,"profile_background_color":"F5F8FA","profile_background_image_url":"","profile_background_image_url_https":"","profile_background_tile":false,"profile_link_color":"1DA1F2","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"profile_image_url":"http://pbs.twimg.com/profile_images/1053957260974542848/RrRuZL1g_normal.jpg","profile_image_url_https":"https://pbs.twimg.com/profile_images/1053957260974542848/RrRuZL1g_normal.jpg","profile_banner_url":"https://pbs.twimg.com/profile_banners/796185239370379264/1531817659","default_profile":true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"extended_tweet":{"full_text":"@nparama1951 @RBhamaria @jyotsnavarma9 @JaganNKaushik @DineshA58 @Am_dilip @ashvinn15 @SChakram @Savitritvs @Satishrathod100 @banerji1 @ramakirao @RaghavendraUp16 @ads7506 @Kumaran92023000 @kjayashree31 @gouranga1964 @SureshanDelhi @ravi_sec @faramroze @kavita_tewari @kailashkaushik8 @pushprajdumraon @FatyachandJ @sukumaranlens @Hydbiryani11 @ChaudhrGurnam @DurgaMaddikonda @ShibaBhanja @aarjeekaykannan @singhsantosh98 @badi_mishra @LighteningBolt9 @birajanath @sn_ojha @Speakwithsence1 @dharmvirjangra9 @LillyMaryPinto @RohiniShah73 @postcard_news @MailOnline @EconomicTimes @narendramodi @BJP4India @AmitShah @TarekFatah @TrueIndology @republic @TelegraphTech 10 Naxals killed in encounter with security forces in Chhattisgarh","display_text_range":[665,731],"entities":{"hashtags":[],"urls":[],"user_mentions":[{"screen_name":"nparama1951","name":"N.Paramasivam","id":2783847553,"id_str":"2783847553","indices":[0,12]},{"screen_name":"RBhamaria","name":"Capt. Ritesh Bhamaria \ud83c\uddee\ud83c\uddf3 \ud83c\udde6\ud83c\uddfa","id":326234086,"id_str":"326234086","indices":[13,23]},{"screen_name":"jyotsnavarma9","name":"Jyotsna Varma \ud83c\uddee\ud83c\uddf3","id":3166184569,"id_str":"3166184569","indices":[24,38]},{"screen_name":"JaganNKaushik","name":"JN Kaushik","id":878303278420840448,"id_str":"878303278420840448","indices":[39,53]},{"screen_name":"DineshA58","name":"Dinesh Agarawal","id":741906012194607104,"id_str":"741906012194607104","indices":[54,64]},{"screen_name":"Am_dilip","name":"dilip","id":2475549384,"id_str":"2475549384","indices":[65,74]},{"screen_name":"ashvinn15","name":"Ashwin","id":2877219241,"id_str":"2877219241","indices":[75,85]},{"screen_name":"SChakram","name":"Sudarshan Chakram","id":219893148,"id_str":"219893148","indices":[86,95]},{"screen_name":"Savitritvs","name":"Savitri S","id":954272364849606662,"id_str":"954272364849606662","indices":[96,107]},{"screen_name":"Satishrathod100","name":"Satish Rathod","id":762714933188591616,"id_str":"762714933188591616","indices":[108,124]},{"screen_name":"banerji1","name":"butterfly #badhindu","id":22753350,"id_str":"22753350","indices":[125,134]},{"screen_name":"ramakirao","name":"Ramakrishna UR","id":2889597709,"id_str":"2889597709","indices":[135,145]},{"screen_name":"RaghavendraUp16","name":"Raghavendra Upadhya","id":930116405105639424,"id_str":"930116405105639424","indices":[146,162]},{"screen_name":"ads7506","name":"Atindra Shukla\ud83c\uddee\ud83c\uddf3","id":267681006,"id_str":"267681006","indices":[163,171]},{"screen_name":"Kumaran92023000","name":"Kumaran","id":1070710084441784320,"id_str":"1070710084441784320","indices":[172,188]},{"screen_name":"kjayashree31","name":"Jaya Iyer","id":3252380094,"id_str":"3252380094","indices":[189,202]},{"screen_name":"gouranga1964","name":"gouranga","id":883271109294137344,"id_str":"883271109294137344","indices":[203,216]},{"screen_name":"SureshanDelhi","name":"psureshan","id":76917843,"id_str":"76917843","indices":[217,231]},{"screen_name":"ravi_sec","name":"Ravi Kiren","id":105771045,"id_str":"105771045","indices":[232,241]},{"screen_name":"faramroze","name":"Faramroze \ud83c\udf31\ud83c\udf3f\ud83c\udf3e","id":1007265900418891777,"id_str":"1007265900418891777","indices":[242,252]},{"screen_name":"kavita_tewari","name":"kavi \ud83c\uddee\ud83c\uddf3\ud83c\uddee\ud83c\uddf3","id":2952276812,"id_str":"2952276812","indices":[253,267]},{"screen_name":"kailashkaushik8","name":"Kailash Kaushik","id":2206428378,"id_str":"2206428378","indices":[268,284]},{"screen_name":"pushprajdumraon","name":"Pushpraj Singh","id":805466304769654785,"id_str":"805466304769654785","indices":[285,301]},{"screen_name":"FatyachandJ","name":"FATYACHAND JETWANI","id":2345449561,"id_str":"2345449561","indices":[302,314]},{"screen_name":"sukumaranlens","name":"Bhairava","id":964091510630297601,"id_str":"964091510630297601","indices":[315,329]},{"screen_name":"Hydbiryani11","name":"sanatanadharmi","id":791069964434276357,"id_str":"791069964434276357","indices":[330,343]},{"screen_name":"ChaudhrGurnam","name":"Air Mshl GSChaudhry PVSM, AVSM,VSM","id":801423504352514048,"id_str":"801423504352514048","indices":[344,358]},{"screen_name":"DurgaMaddikonda","name":"Kanaka Durga Prasad Maddikonda","id":971373447757619200,"id_str":"971373447757619200","indices":[359,375]},{"screen_name":"ShibaBhanja","name":"Shiba Prasad Bhanja","id":1045647290084413440,"id_str":"1045647290084413440","indices":[376,388]},{"screen_name":"aarjeekaykannan","name":"r g kannan","id":1127245123,"id_str":"1127245123","indices":[389,405]},{"screen_name":"singhsantosh98","name":"Santosh Singh","id":947123021495525376,"id_str":"947123021495525376","indices":[406,421]},{"screen_name":"badi_mishra","name":"Satya badi Mishra","id":1068305802245459968,"id_str":"1068305802245459968","indices":[422,434]},{"screen_name":"LighteningBolt9","name":"LightningBolt\u274c#MaymustGo","id":963238016457347072,"id_str":"963238016457347072","indices":[435,451]},{"screen_name":"birajanath","name":"Chaiwala Bhakt #RSS #BadHindu","id":113578227,"id_str":"113578227","indices":[452,463]},{"screen_name":"sn_ojha","name":"Dr S N Ojha\ud83c\uddee\ud83c\uddf3","id":560927596,"id_str":"560927596","indices":[464,472]},{"screen_name":"Speakwithsence1","name":"Speakwithsense","id":964835386403860482,"id_str":"964835386403860482","indices":[473,489]},{"screen_name":"dharmvirjangra9","name":"\u0927\u0930\u094d\u092e\u0935\u0940\u0930 \u092c\u094c\u0928\u094d\u0926\u0935\u093e\u0932","id":3369674594,"id_str":"3369674594","indices":[490,506]},{"screen_name":"LillyMaryPinto","name":"Lilly \u0932\u093f\u0932\u094d\u0932\u0940 \u0cb2\u0cbf\u0cb2\u0ccd\u0cb2\u0cbf \ud83c\uddee\ud83c\uddf3","id":2801729758,"id_str":"2801729758","indices":[507,522]},{"screen_name":"RohiniShah73","name":"Rohini Shah \ud83c\uddee\ud83c\uddf3","id":3300890464,"id_str":"3300890464","indices":[523,536]},{"screen_name":"postcard_news","name":"Post Card","id":3179331468,"id_str":"3179331468","indices":[537,551]},{"screen_name":"MailOnline","name":"Daily Mail Online","id":15438913,"id_str":"15438913","indices":[552,563]},{"screen_name":"EconomicTimes","name":"EconomicTimes","id":39743812,"id_str":"39743812","indices":[564,578]},{"screen_name":"narendramodi","name":"Narendra Modi","id":18839785,"id_str":"18839785","indices":[579,592]},{"screen_name":"BJP4India","name":"BJP","id":207809313,"id_str":"207809313","indices":[593,603]},{"screen_name":"AmitShah","name":"Amit Shah","id":1447949844,"id_str":"1447949844","indices":[604,613]},{"screen_name":"TarekFatah","name":"Tarek Fatah","id":17537467,"id_str":"17537467","indices":[614,625]},{"screen_name":"TrueIndology","name":"True Indology","id":4472065032,"id_str":"4472065032","indices":[626,639]},{"screen_name":"republic","name":"Republic","id":811972460560019456,"id_str":"811972460560019456","indices":[640,649]},{"screen_name":"TelegraphTech","name":"Telegraph Technology Intelligence","id":19712106,"id_str":"19712106","indices":[650,664]}],"symbols":[]}},"quote_count":0,"reply_count":1,"retweet_count":1,"favorite_count":2,"entities":{"hashtags":[],"urls":[{"url":"https://t.co/lfjAiatkbP","expanded_url":"https://twitter.com/i/web/status/1093434772070658048","display_url":"twitter.com/i/web/status/1\u2026","indices":[109,132]}],"user_mentions":[{"screen_name":"nparama1951","name":"N.Paramasivam","id":2783847553,"id_str":"2783847553","indices":[0,12]},{"screen_name":"RBhamaria","name":"Capt. Ritesh Bhamaria \ud83c\uddee\ud83c\uddf3 \ud83c\udde6\ud83c\uddfa","id":326234086,"id_str":"326234086","indices":[13,23]},{"screen_name":"jyotsnavarma9","name":"Jyotsna Varma \ud83c\uddee\ud83c\uddf3","id":3166184569,"id_str":"3166184569","indices":[24,38]},{"screen_name":"JaganNKaushik","name":"JN Kaushik","id":878303278420840448,"id_str":"878303278420840448","indices":[39,53]},{"screen_name":"DineshA58","name":"Dinesh Agarawal","id":741906012194607104,"id_str":"741906012194607104","indices":[54,64]},{"screen_name":"Am_dilip","name":"dilip","id":2475549384,"id_str":"2475549384","indices":[65,74]},{"screen_name":"ashvinn15","name":"Ashwin","id":2877219241,"id_str":"2877219241","indices":[75,85]},{"screen_name":"SChakram","name":"Sudarshan Chakram","id":219893148,"id_str":"219893148","indices":[86,95]},{"screen_name":"Savitritvs","name":"Savitri S","id":954272364849606662,"id_str":"954272364849606662","indices":[96,107]}],"symbols":[]},"favorited":false,"retweeted":false,"filter_level":"low","lang":"en"},"is_quote_status":false,"quote_count":0,"reply_count":0,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[{"screen_name":"sethia_b","name":"B.Sethia","id":796185239370379264,"id_str":"796185239370379264","indices":[3,12]},{"screen_name":"nparama1951","name":"N.Paramasivam","id":2783847553,"id_str":"2783847553","indices":[14,26]},{"screen_name":"RBhamaria","name":"Capt. Ritesh Bhamaria \ud83c\uddee\ud83c\uddf3 \ud83c\udde6\ud83c\uddfa","id":326234086,"id_str":"326234086","indices":[27,37]},{"screen_name":"jyotsnavarma9","name":"Jyotsna Varma \ud83c\uddee\ud83c\uddf3","id":3166184569,"id_str":"3166184569","indices":[38,52]},{"screen_name":"JaganNKaushik","name":"JN Kaushik","id":878303278420840448,"id_str":"878303278420840448","indices":[53,67]},{"screen_name":"DineshA58","name":"Dinesh Agarawal","id":741906012194607104,"id_str":"741906012194607104","indices":[68,78]},{"screen_name":"Am_dilip","name":"dilip","id":2475549384,"id_str":"2475549384","indices":[79,88]},{"screen_name":"ashvinn15","name":"Ashwin","id":2877219241,"id_str":"2877219241","indices":[89,99]},{"screen_name":"SChakram","name":"Sudarshan Chakram","id":219893148,"id_str":"219893148","indices":[100,109]},{"screen_name":"Savitritvs","name":"Savitri S","id":954272364849606662,"id_str":"954272364849606662","indices":[110,121]},{"screen_name":"Satishrathod100","name":"Satish Rathod","id":762714933188591616,"id_str":"762714933188591616","indices":[122,138]}],"symbols":[]},"favorited":false,"retweeted":false,"filter_level":"low","lang":"en","timestamp_ms":"1549537107864"}
最佳答案
这看起来像 ndjson。 ndjson
和 jsonlite
包都可以处理它。
dat <- ndjson::stream_in("data/INCIndia26febru.json")
# Source: local data table [1,584 x 2,814]
#
# # A tibble: 1,584 x 2,814
# contributors coordinates created_at entities.hashta… entities.symbols entities.urls entities.user_m…
# <int> <int> <chr> <int> <int> <int> <dbl>
# 1 NA NA Tue Feb 2… NA NA NA 1.15e 9
# 2 NA NA Tue Feb 2… NA NA NA 1.15e 9
# 3 NA NA Tue Feb 2… NA NA NA 2.23e 8
# 4 NA NA Tue Feb 2… NA NA NA 7.44e 7
# 5 NA NA Tue Feb 2… NA NA NA 1.06e18
# 6 NA NA Tue Feb 2… NA NA NA 1.47e 8
# 7 NA NA Tue Feb 2… NA NA NA 7.44e 7
# 8 NA NA Tue Feb 2… NA NA NA 1.15e 9
# 9 NA NA Tue Feb 2… NA NA NA 1.15e 9
# 10 NA NA Tue Feb 2… NA NA NA 7.44e 7
# # … with 1,574 more rows, and 2,807 more variables: entities.user_mentions.0.id_str <chr>,
# # entities.user_mentions.0.indices.0 <dbl>, entities.user_mentions.0.indices.1 <dbl>,
# # entities.user_mentions.0.name <chr>, entities.user_mentions.1.id <dbl>,
# # entities.user_mentions.0.screen_name <chr>, entities.user_mentions.1.id_str <chr>,
# # entities.user_mentions.1.indices.0 <dbl>, retweeted_status.entities.user_mentions.0.name <chr>,
# # retweeted_status.entities.user_mentions.0.screen_name <chr>,
# # retweeted_status.extended_tweet.display_text_range.0 <dbl>,
# # retweeted_status.entities.user_mentions.0.id_str <chr>,
# # retweeted_status.entities.user_mentions.0.indices.0 <dbl>,
# # retweeted_status.entities.user_mentions.0.indices.1 <dbl>, retweeted_status.entities.urls.0.url <chr>,
# # retweeted_status.entities.user_mentions.0.id <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.media_url_https <chr>,
# # retweeted_status.extended_tweet.entities.media.0.sizes.large.h <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.sizes.medium.h <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.sizes.large.resize <chr>,
# # retweeted_status.extended_tweet.entities.media.0.sizes.large.w <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.indices.0 <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.indices.1 <dbl>,
# # retweeted_status.extended_tweet.entities.media.0.media_url <chr>, in_reply_to_user_id_str <chr>,
# # in_reply_to_status_id_str <chr>, is_quote_status <lgl>, lang <chr>, id_str <chr>,
# # in_reply_to_screen_name <chr>, in_reply_to_status_id <dbl>, in_reply_to_user_id <dbl>, retweet_count <dbl>,
# # place <int>, quote_count <dbl>, retweeted <lgl>, retweeted_status.contributors <int>, reply_count <dbl>,
# # retweeted_status.coordinates <int>, retweeted_status.created_at <chr>, user.created_at <chr>,
# # user.contributors_enabled <lgl>, retweeted_status.user.utc_offset <int>,
# # retweeted_status.user.verified <lgl>, source <chr>, text <chr>, timestamp_ms <chr>, truncated <lgl>,
# # user.default_profile <lgl>, user.following <int>, user.default_profile_image <lgl>, user.description <chr>,
# # user.follow_request_sent <int>, user.followers_count <dbl>, user.friends_count <dbl>,
# # user.favourites_count <dbl>, quoted_status.extended_tweet.extended_entities.media.0.sizes.thumb.resize <chr>,
# # quoted_status.extended_tweet.extended_entities.media.0.sizes.thumb.w <dbl>,
# # quoted_status.extended_tweet.extended_entities.media.0.video_info.aspect_ratio.0 <dbl>,
# # quoted_status.extended_tweet.extended_entities.media.0.video_info.aspect_ratio.1 <dbl>,
# # quoted_status.extended_tweet.extended_entities.media.0.type <chr>,
# # quoted_status.extended_tweet.extended_entities.media.0.video_info.duration_millis <dbl>,
# # quoted_status.extended_tweet.extended_entities.media.0.video_info.variants.0.bitrate <dbl>,
# # quoted_status.extended_tweet.extended_entities.media.0.url <chr>,
# # retweeted_status.entities.hashtags.0.indices.0 <dbl>, retweeted_status.entities.hashtags.0.indices.1 <dbl>,
# # retweeted_status.entities.hashtags.0.text <chr>, favorite_count <dbl>,
# # entities.user_mentions.1.indices.1 <dbl>, entities.user_mentions.1.name <chr>,
# # entities.user_mentions.1.screen_name <chr>, favorited <lgl>, filter_level <chr>, geo <int>, id <dbl>,
# # retweeted_status.favorite_count <dbl>, retweeted_status.favorited <lgl>, retweeted_status.filter_level <chr>,
# # retweeted_status.extended_tweet.full_text <chr>,
# # retweeted_status.extended_tweet.extended_entities.media.1.sizes.thumb.resize <chr>,
# # retweeted_status.extended_tweet.extended_entities.media.1.sizes.thumb.w <dbl>,
# # retweeted_status.extended_tweet.extended_entities.media.1.type <chr>,
# # retweeted_status.extended_tweet.extended_entities.media.1.url <chr>, user.id_str <chr>,
# # user.is_translator <lgl>, user.lang <chr>, user.listed_count <dbl>, user.location <chr>, user.name <chr>,
# # user.geo_enabled <lgl>, user.id <dbl>, retweeted_status.display_text_range.0 <dbl>,
# # retweeted_status.display_text_range.1 <dbl>, retweeted_status.entities.hashtags <int>,
# # retweeted_status.entities.symbols <int>, retweeted_status.entities.urls.0.display_url <chr>,
# # retweeted_status.entities.urls.0.expanded_url <chr>, retweeted_status.entities.urls.0.indices.0 <dbl>,
# # retweeted_status.entities.urls.0.indices.1 <dbl>, retweeted_status.geo <int>, …
或者:
dat <- jsonlite::stream_in(file("data/INCIndia26febru.json"))
tibble::glimpse(dat)
# Observations: 1,584
# Variables: 36
# $ created_at <chr> "Tue Feb 26 13:09:36 +0000 2019", "Tue Feb 26 13:09:38 +0000 2019", "Tue Feb …
# $ id <dbl> 1.100382e+18, 1.100382e+18, 1.100382e+18, 1.100382e+18, 1.100382e+18, 1.10038…
# $ id_str <chr> "1100382373823299586", "1100382382396448770", "1100382385013645314", "1100382…
# $ text <chr> "RT @INCIndia: Congress President @RahulGandhi addresses North-East DCC &…
# $ source <chr> "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for…
# $ truncated <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, …
# $ in_reply_to_status_id <dbl> NA, 1.100360e+18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
# $ in_reply_to_status_id_str <chr> NA, "1100359823630237697", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
# $ in_reply_to_user_id <dbl> NA, 1.153045e+09, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
# $ in_reply_to_user_id_str <chr> NA, "1153045459", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
# $ in_reply_to_screen_name <chr> NA, "INCIndia", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
# $ user <data.frame> <data.frame[38 x 39]>
# $ geo <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
# $ coordinates <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
# $ place <data.frame> <data.frame[38 x 9]>
# $ contributors <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N…
# $ retweeted_status <data.frame> <data.frame[38 x 34]>
# $ is_quote_status <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FA…
# $ quote_count <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
# $ reply_count <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
# $ retweet_count <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
# $ favorite_count <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
# $ entities <data.frame> <data.frame[38 x 5]>
# $ favorited <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, …
# $ retweeted <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, …
# $ filter_level <chr> "low", "low", "low", "low", "low", "low", "low", "low", "low", "low", "low", …
# $ lang <chr> "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en", "en",…
# $ timestamp_ms <chr> "1551186576692", "1551186578736", "1551186579360", "1551186579893", "15511865…
# $ display_text_range <list> [NULL, <23, 100>, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL…
# $ possibly_sensitive <lgl> NA, NA, NA, NA, FALSE, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA…
# $ quoted_status_id <dbl> NA, NA, NA, NA, NA, NA, 1.100365e+18, NA, NA, 1.100365e+18, NA, NA, 1.100365e…
# $ quoted_status_id_str <chr> NA, NA, NA, NA, NA, NA, "1100364859768782849", NA, NA, "1100364859768782849",…
# $ quoted_status <data.frame> <data.frame[38 x 32]>
# $ quoted_status_permalink <data.frame> <data.frame[38 x 3]>
# $ extended_tweet <data.frame> <data.frame[38 x 4]>
# $ extended_entities <data.frame> <data.frame[38 x 1]>
关于r - 展平深度嵌套且格式错误的 JSON 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55160338/
我正在从 Stata 迁移到 R(plm 包),以便进行面板模型计量经济学。在 Stata 中,面板模型(例如随机效应)通常报告组内、组间和整体 R 平方。 I have found plm 随机效应
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 6年前关闭。 Improve this qu
我想要求用户输入整数值列表。用户可以输入单个值或一组多个值,如 1 2 3(spcae 或逗号分隔)然后使用输入的数据进行进一步计算。 我正在使用下面的代码 EXP <- as.integer(rea
当 R 使用分类变量执行回归时,它实际上是虚拟编码。也就是说,省略了一个级别作为基础或引用,并且回归公式包括所有其他级别的虚拟变量。但是,R 选择了哪一个作为引用,以及我如何影响这个选择? 具有四个级
这个问题基本上是我之前问过的问题的延伸:How to only print (adjusted) R-squared of regression model? 我想建立一个线性回归模型来预测具有 15
我在一台安装了多个软件包的 Linux 计算机上安装了 R。现在我正在另一台 Linux 计算机上设置 R。从他们的存储库安装 R 很容易,但我将不得不使用 安装许多包 install.package
我正在阅读 Hadley 的高级 R 编程,当它讨论字符的内存大小时,它说: R has a global string pool. This means that each unique strin
我们可以将 Shiny 代码写在两个单独的文件中,"ui.R"和 "server.R" , 或者我们可以将两个模块写入一个文件 "app.R"并调用函数shinyApp() 这两种方法中的任何一种在性
我正在使用 R 通过 RGP 包进行遗传编程。环境创造了解决问题的功能。我想将这些函数保存在它们自己的 .R 源文件中。我这辈子都想不通怎么办。我尝试过的一种方法是: bf_str = print(b
假设我创建了一个函数“function.r”,在编辑该函数后我必须通过 source('function.r') 重新加载到我的全局环境中。无论如何,每次我进行编辑时,我是否可以避免将其重新加载到我的
例如,test.R 是一个单行文件: $ cat test.R # print('Hello, world!') 我们可以通过Rscript test.R 或R CMD BATCH test.R 来
我知道我可以使用 Rmd 来构建包插图,但想知道是否可以更具体地使用 R Notebooks 来制作包插图。如果是这样,我需要将 R Notebooks 编写为包小插图有什么不同吗?我正在使用最新版本
我正在考虑使用 R 包的共享库进行 R 的站点安装。 多台计算机将访问该库,以便每个人共享相同的设置。 问题是我注意到有时您无法更新包,因为另一个 R 实例正在锁定库。我不能要求每个人都关闭它的 R
我知道如何从命令行启动 R 并执行表达式(例如, R -e 'print("hello")' )或从文件中获取输入(例如, R -f filename.r )。但是,在这两种情况下,R 都会运行文件中
我正在尝试使我当前的项目可重现,因此我正在创建一个主文档(最终是一个 .rmd 文件),用于调用和执行其他几个文档。这样我自己和其他调查员只需要打开和运行一个文件。 当前设置分为三层:主文件、2 个读
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 5年前关闭。 Improve this qu
我的 R 包中有以下描述文件 Package: blah Title: What the Package Does (one line, title case) Version: 0.0.0.9000
有没有办法更有效地编写以下语句?accel 是一个数据框。 accel[[2]]<- accel[[2]]-weighted.mean(accel[[2]]) accel[[3]]<- accel[[
例如,在尝试安装 R 包时 curl作为 usethis 的依赖项: * installing *source* package ‘curl’ ... ** package ‘curl’ succes
我想将一些软件作为一个包共享,但我的一些脚本似乎并不能很自然地作为函数运行。例如,考虑以下代码块,其中“raw.df”是一个包含离散和连续类型变量的数据框。函数“count.unique”和“squa
我是一名优秀的程序员,十分优秀!