Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(tm)
- posts <- structure(list(created_time = structure(c(1500042659, 1500042059,
- 1500039638, 1500036945, 1500036300, 1500033950, 1500031022), tzone = "UTC", class = c("POSIXct",
- "POSIXt")), description = c(NA_character_, NA_character_, NA_character_,
- NA_character_, NA_character_, NA_character_, NA_character_),
- link = c("https://www.facebook.com/bbcnews/videos/10154890879532217/",
- "http://bbc.in/2talMsx", "https://www.facebook.com/bbcnews/videos/10154890852247217/",
- "https://www.facebook.com/bbcnews/videos/1426789250735491/",
- "https://www.facebook.com/bbcnews/videos/10154890645702217/",
- "http://bbc.in/2upZBP3", "http://bbc.in/2uqthLM"), message = c("We are #LIVE outside the National Rifle Association of America's headquarters for a demonstration organised by the Women's March. The BBC's Hetal Gandhi is speaking to NRA supporters and activists from the Women's March about the recent verdict in #PhilandoCastile's death and a controversial NRA commercial - that sparked this event. Share your questions below.",
- "UPDATE: \r\n-2 Ukrainian tourists killed in stabbing at hotel in Red Sea resort of Hurghada in Egypt. \r\n-Four others wounded. \r\n-Suspect arrested, officials say.",
- "Proms: Come with us on a tour of the Royal Albert Hall as preparations are underway for the biggest classical music festival in the world - the Proms. Check out https://www.bbc.co.uk/proms for the full schedule of events.",
- "Thousands say their final goodbyes to Bradley Lowery http://bbc.in/2ugAwWm <U+0001F499>\r\n\r\n(Via BBC Look North (North East & Cumbria))",
- "Despite safety warnings, this beach near an airport has become a world-famous attraction. Tourists get up close to planes, with sometimes devastating consequences. bbc.in/2sSscbj",
- "\"Grandparents are the epitome of close family members\" - a judge in Hawaii has dealt another blow to Donald J. Trump's travel ban.",
- "Thousands have come to say goodbye to Bradley Lowery, the six-year-old Sunderland AFC fan who died from cancer, police say."
- ), page_id = c(228735667216, 228735667216, 228735667216,
- 228735667216, 228735667216, 228735667216, 228735667216),
- post_id = c("228735667216_10154890879532217", "228735667216_10154890968202217",
- "228735667216_10154890852247217", "228735667216_1426789250735491",
- "228735667216_10154890645702217", "228735667216_10154890600247217",
- "228735667216_10154890480662217"), react_angry = c(54, 172,
- 5, 6, 65, 25, 0), react_haha = c(24, 8, 12, 0, 513, 136,
- 2), react_like = c(993, 994, 2034, 2262, 4336, 2549, 4123
- ), react_love = c(144, 11, 369, 754, 54, 195, 1005), react_sad = c(12,
- 783, 6, 1989, 128, 2, 2256), react_wow = c(24, 264, 45, 11,
- 815, 17, 41), scrape_time = structure(c(1500030084.37986,
- 1500030084.37986, 1500030084.37986, 1500030084.37986, 1500030084.37986,
- 1500030084.37986, 1500030084.37986), tzone = "UTC", class = c("POSIXct",
- "POSIXt")), shares = c(139, 680, 395, 542, 1956, 159, 560
- )), row.names = c(NA, -7L), class = c("tbl_df", "tbl", "data.frame"
- ))
- texts = posts$message
- texts <- iconv(texts, 'UTF-8', 'ASCII')
- corpus <- Corpus(VectorSource(texts))
- inspect(corpus[[4]])
Advertisement
Add Comment
Please, Sign In to add comment