##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
In this assignment, we are tasked to create an developer account within The New York Times website APIs, similarly describe here: https://developer.nytimes.com/apis and further read the information within the JSON data that the API provides and create a dataframe for future analysis. In order to do this, we select one of the Publicly available API’s listed in the New York times API Catalog. I have selected Most Popular API and further created an app with an ID and an API Key.
The Most Popular API provides a service getting the most popular articles on NYtimes.com based on emails, shares or views. In this case, I wanted to look at the most shared nytimes articles via facbook for the last 7 days. Based on the documentation provided in the developer guide, my api call should look something like this: " https://api.nytimes.com/svc/mostpopular/v2/shared/7/facebook.json "
url <- "https://api.nytimes.com/svc/mostpopular/v2/shared/7/facebook.json"
api_key <- "qGvyiL1P77XmJvdGxUu4vufM462qN59H"
#update the url with api key structure example: https://api.nytimes.com/svc/mostpopular/v2/shared/1/facebook.json?api-key=yourkey
url <- paste(url, "?", "api-key=", api_key, sep = "")
fb_shares <- GET(url, verbose())
fb_shares## Response [https://api.nytimes.com/svc/mostpopular/v2/shared/7/facebook.json?api-key=qGvyiL1P77XmJvdGxUu4vufM462qN59H]
## Date: 2019-10-27 18:21
## Status: 200
## Content-Type: application/json; charset=UTF-8
## Size: 39.6 kB
#set content and read it from JSON
content <- content(fb_shares, "text")
fb_shares <- fromJSON(content)
#create the dataframe
fb_shares <- as.data.frame(fb_shares)
fb_shares## status
## 1 OK
## 2 OK
## 3 OK
## 4 OK
## 5 OK
## 6 OK
## 7 OK
## 8 OK
## 9 OK
## 10 OK
## 11 OK
## 12 OK
## 13 OK
## 14 OK
## 15 OK
## 16 OK
## 17 OK
## 18 OK
## 19 OK
## 20 OK
## copyright
## 1 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 2 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 3 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 4 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 5 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 6 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 7 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 8 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 9 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 10 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 11 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 12 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 13 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 14 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 15 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 16 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 17 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 18 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 19 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## 20 Copyright (c) 2019 The New York Times Company. All Rights Reserved.
## num_results
## 1 1473
## 2 1473
## 3 1473
## 4 1473
## 5 1473
## 6 1473
## 7 1473
## 8 1473
## 9 1473
## 10 1473
## 11 1473
## 12 1473
## 13 1473
## 14 1473
## 15 1473
## 16 1473
## 17 1473
## 18 1473
## 19 1473
## 20 1473
## results.url
## 1 https://www.nytimes.com/2019/10/20/world/americas/Haiti-crisis-violence.html
## 2 https://www.nytimes.com/2019/10/17/opinion/trump-mcraven-syria-military.html
## 3 https://www.nytimes.com/2019/10/23/parenting/the-lasting-trauma-of-infertility.html
## 4 https://www.nytimes.com/2019/09/24/science/cats-humans-bonding.html
## 5 https://www.nytimes.com/2019/10/25/business/rachel-maddow-ronan-farrow-nbc.html
## 6 https://www.nytimes.com/2019/09/17/style/the-awkward-art-of-office-small-talk.html
## 7 https://www.nytimes.com/2019/10/22/us/politics/democratic-candidates-2020.html
## 8 https://www.nytimes.com/2019/10/19/nyregion/action-park-movie.html
## 9 https://www.nytimes.com/2019/09/06/style/modern-love-his-family-had-money-mine-didnt.html
## 10 https://www.nytimes.com/2019/10/24/us/politics/john-durham-criminal-investigation.html
## 11 https://www.nytimes.com/2019/09/24/dining/family-meals-around-the-world.html
## 12 https://www.nytimes.com/2019/08/15/smarter-living/what-makes-people-charismatic-and-how-you-can-be-too.html
## 13 https://www.nytimes.com/2019/10/18/opinion/trump-impeachment-republicans.html
## 14 https://www.nytimes.com/2019/08/30/arts/gem-o-rama-crystals.html
## 15 https://www.nytimes.com/2019/10/22/us/trump-impeachment-ukraine.html
## 16 https://www.nytimes.com/2019/02/27/us/immigrant-children-sexual-abuse.html
## 17 https://www.nytimes.com/2019/10/23/health/breast-implants-fda.html
## 18 https://www.nytimes.com/2019/10/24/us/politics/laura-cooper-pentagon-letter.html
## 19 https://www.nytimes.com/2019/10/23/world/europe/egypt-sisi-ali-corruption-spain.html
## 20 https://www.nytimes.com/2019/10/20/opinion/trump-impeachment-protests.html
## results.adx_keywords
## 1 Haiti;Demonstrations, Protests and Riots;Politics and Government;Power Failures and Blackouts;Moise, Jovenel (1968- );Shortages;Hospitals;Sainte Croix Hospital (Leogane, Haiti)
## 2 Trump, Donald J;United States Politics and Government;United States Defense and Military Forces;United States International Relations
## 3 In Vitro Fertilization;Anxiety and Stress;Mental Health and Disorders;Parenting;Infertility
## 4 Animal Behavior;Cats;Dogs;Anxiety and Stress;Families and Family Life;Love (Emotion);Current Biology (Journal);Oregon State University
## 5 MSNBC;Maddow, Rachel;Farrow, Ronan;Catch and Kill: Lies, Spies, and a Conspiracy to Protect Predators (Book);NBC News;News and News Media;Television;#MeToo Movement;McHugh, Rich;Oppenheim, Noah;Lack, Andrew;Books and Literature;Sexual Harassment;Sex Crimes
## 6 Workplace Environment;Customs, Etiquette and Manners;your-feed-selfcare;your-feed-work
## 7 Democratic Party;Presidential Election of 2020;Primaries and Caucuses;United States Politics and Government;Biden, Joseph R Jr;Warren, Elizabeth;Clinton, Hillary Rodham;Bloomberg, Michael R;Third-Party Politics (US)
## 8 Amusement and Theme Parks;Deaths (Fatalities);Documentary Films and Programs;Class Action Park (Movie);Porges, Seth;Scott, Chris Charles;Mulvihill, Andy;Mulvihill, Eugene;Action Park;Accidents and Safety
## 9 Love (Emotion);Dating and Relationships;Private and Sectarian Schools;England
## 10 Russian Interference in 2016 US Elections and Ties to Trump Associates;United States Politics and Government;Trump-Ukraine Whistle-Blower Complaint and Impeachment Inquiry;Presidential Election of 2016;Espionage and Intelligence Services;Surveillance of Citizens by Government;Special Prosecutors (Independent Counsel);Central Intelligence Agency;Federal Bureau of Investigation;Justice Department;Barr, William P;Brennan, John O;Clapper, James R Jr;Comey, James B;Durham, John H;Trump, Donald J;Russia;Ukraine
## 11 weeknight cooking;Cooking and Cookbooks;Families and Family Life;Bangkok (Thailand);Gurgaon (India);Rome (Italy);Riyadh (Saudi Arabia);Port-au-Prince (Haiti);Israel;Paris (France);Kwazulu-Natal Province (South Africa);Australia;Lima (Peru);Amsterdam (Netherlands);Texas;Lagos (Nigeria);Monterrey (Mexico);Moscow (Russia);Tokyo (Japan);Istanbul (Turkey);Sao Paulo (Brazil)
## 12 Public Speaking;Toastmasters International;Parties (Social);Psychology and Psychologists
## 13 Trump, Donald J;Republican Party;Trump-Ukraine Whistle-Blower Complaint and Impeachment Inquiry;United States Politics and Government;Constitution (US);Smith, Margaret Chase
## 14 Crystals;Salt;Geology;Rock and Stone;Mines and Mining;California;Surfacing 2019;Gem-O-Rama (Event);Searles Lake (Calif)
## 15 Taylor, William B Jr;Trump-Ukraine Whistle-Blower Complaint and Impeachment Inquiry;United States International Relations;Diplomatic Service, Embassies and Consulates;Trump, Donald J;Sondland, Gordon D (1957- );Zelensky, Volodymyr;Ukraine;House of Representatives
## 16 Sex Crimes;Child Abuse and Neglect;Illegal Immigration;Immigration and Emigration;United States Politics and Government;Immigration Detention;Sexual Harassment;Refugees and Displaced Persons;Health and Human Services Department;Office of Refugee Resettlement;Deutch, Ted (1966- )
## 17 your-feed-science;Implants;Breasts;Medical Devices;Breast Cancer;Plastic Surgery;Labeling and Labels (Product);Surgery and Surgeons;Silicone;Autoimmune Diseases;Allergan Inc;Food and Drug Administration
## 18 United States Politics and Government;Trump-Ukraine Whistle-Blower Complaint and Impeachment Inquiry;United States Defense and Military Forces;Defense Department;House Committee on Intelligence;Ukraine;Impeachment;Trump, Donald J;Cooper, Laura K
## 19 Politics and Government;Demonstrations, Protests and Riots;Ali, Mohamed (Activist);Sisi, Abdel Fattah el-;Egypt;Barcelona (Spain);Corruption (Institutional)
## 20 United States Politics and Government;Trump-Ukraine Whistle-Blower Complaint and Impeachment Inquiry;Patient Protection and Affordable Care Act (2010);Demonstrations, Protests and Riots;Polls and Public Opinion;Impeachment;Democratic Party;Republican Party;Trump, Donald J
## results.subsection results.share_count results.count_type
## 1 americas 1 SHARED-FACEBOOK
## 2 2 SHARED-FACEBOOK
## 3 3 SHARED-FACEBOOK
## 4 4 SHARED-FACEBOOK
## 5 5 SHARED-FACEBOOK
## 6 6 SHARED-FACEBOOK
## 7 politics 7 SHARED-FACEBOOK
## 8 8 SHARED-FACEBOOK
## 9 9 SHARED-FACEBOOK
## 10 politics 10 SHARED-FACEBOOK
## 11 11 SHARED-FACEBOOK
## 12 12 SHARED-FACEBOOK
## 13 13 SHARED-FACEBOOK
## 14 14 SHARED-FACEBOOK
## 15 15 SHARED-FACEBOOK
## 16 16 SHARED-FACEBOOK
## 17 17 SHARED-FACEBOOK
## 18 politics 18 SHARED-FACEBOOK
## 19 europe 19 SHARED-FACEBOOK
## 20 20 SHARED-FACEBOOK
## results.column results.eta_id results.section results.id
## 1 <NA> 0 World 1e+14
## 2 <NA> 0 Opinion 1e+14
## 3 <NA> 0 Parenting 1e+14
## 4 <NA> 0 Science 1e+14
## 5 <NA> 0 Business 1e+14
## 6 The office: AN ANALYSIS 0 Style 1e+14
## 7 <NA> 0 U.S. 1e+14
## 8 <NA> 0 New York 1e+14
## 9 Modern Love 0 Style 1e+14
## 10 <NA> 0 U.S. 1e+14
## 11 <NA> 0 Food 1e+14
## 12 <NA> 0 Smarter Living 1e+14
## 13 <NA> 0 Opinion 1e+14
## 14 Surfacing 0 Arts 1e+14
## 15 <NA> 0 U.S. 1e+14
## 16 <NA> 0 U.S. 1e+14
## 17 <NA> 0 Health 1e+14
## 18 <NA> 0 U.S. 1e+14
## 19 <NA> 0 World 1e+14
## 20 <NA> 0 Opinion 1e+14
## results.asset_id results.nytdsection
## 1 1e+14 world
## 2 1e+14 opinion
## 3 1e+14 parenting
## 4 1e+14 science
## 5 1e+14 business
## 6 1e+14 style
## 7 1e+14 u.s.
## 8 1e+14 new york
## 9 1e+14 style
## 10 1e+14 u.s.
## 11 1e+14 food
## 12 1e+14 smarter living
## 13 1e+14 opinion
## 14 1e+14 arts
## 15 1e+14 u.s.
## 16 1e+14 u.s.
## 17 1e+14 health
## 18 1e+14 u.s.
## 19 1e+14 world
## 20 1e+14 opinion
## results.byline results.type
## 1 By KIRK SEMPLE and MERIDITH KOHUT Article
## 2 By WILLIAM H. MCRAVEN Article
## 3 By REGINA TOWNSEND Article
## 4 By RACHEL NUWER Article
## 5 By JOHN KOBLIN and MICHAEL M. GRYNBAUM Article
## 6 By LINDSAY MANNERING Article
## 7 By JONATHAN MARTIN Article
## 8 By JAMES BARRON Article
## 9 By KATE JACKSON Article
## 10 By KATIE BENNER and ADAM GOLDMAN Article
## 11 By SARA BONISTEEL, KIM GOUGENHEIM and LISA DALSIMER Article
## 12 By BRYAN CLARK Article
## 13 By THE EDITORIAL BOARD Article
## 14 By BRIAN GUIDO and JOSEPHINE SEDGWICK Article
## 15 By MICHAEL D. SHEAR and NICHOLAS FANDOS Article
## 16 By MATTHEW HAAG Article
## 17 By RONI CARYN RABIN Article
## 18 By CHARLIE SAVAGE Article
## 19 By RAPHAEL MINDER Article
## 20 By DAVID LEONHARDT Article
## results.title
## 1 ‘There Is No Hope’: Crisis Pushes Haiti to Brink of Collapse
## 2 Our Republic Is Under Attack From the President
## 3 The Lasting Trauma of Infertility
## 4 Cats Like People! (Some People, Anyway)
## 5 Rachel Maddow Confronts Her NBC News Bosses Live, on the Air
## 6 The Awkward but Essential Art of Office Chitchat
## 7 Anxious Democratic Establishment Asks, ‘Is There Anybody Else?’
## 8 ‘People Were Bleeding All Over’: America’s Most Dangerous Amusement Park
## 9 His Family Had Money. Mine Didn’t.
## 10 Justice Dept. Is Said to Open Criminal Inquiry Into Its Own Russia Investigation
## 11 Weeknight Dinner Around the World
## 12 What Makes People Charismatic, and How You Can Be, Too
## 13 The Crisis of the Republican Party
## 14 What Draws Hundreds to This Lake Bed? Spellbinding Crystals
## 15 Ukraine Envoy Testifies Trump Linked Military Aid to Investigations
## 16 Thousands of Immigrant Children Said They Were Sexually Abused in U.S. Detention Centers, Report Says
## 17 Women Should Be Warned of Breast Implant Hazards, F.D.A. Says
## 18 Read the Trump Administration’s Warning Letter to Laura Cooper
## 19 The Man Trying to Stir a Long-Distance Revolt in Egypt
## 20 Want Trump to Go? Take to the Streets
## results.abstract
## 1 Haitians say the violence and economic stagnation stemming from a clash between the president and the opposition are worse than anything they have ever experienced.
## 2 If President Trump doesn’t demonstrate the leadership that America needs, then it is time for a new person in the Oval Office.
## 3 Even when it ends with a healthy baby, a long struggle to conceive may exact a brutal toll.
## 4 Despite apparent aloofness, cats are social creatures capable of relationships with people, a new study suggests.
## 5 Her remarks came during an episode of her MSNBC show with her former colleague Ronan Farrow as a guest. Mr. Farrow praised her for “speaking truth to power.”
## 6 We regret to inform you that you need to make small talk with your co-workers. Here’s how to master it.
## 7 Party leaders who are fatalistic about Democrats’ chances in 2020 are musing about possible late entrants to the race. Sherrod Brown? Michelle Obama?
## 8 Action Park was infamous for bruises, scars, broken bones — even death. Now it is the subject of a documentary.
## 9 Could our doomed relationship help explain Brexit?
## 10 The move is likely to open the attorney general to accusations that he is trying to deliver a political victory for President Trump.
## 11 We asked 18 families to show us what they have for dinner on a typical weeknight.
## 12 Simple tips to break through your social anxieties and make real, genuine connections with others.
## 13 The G.O.P. will not be able to postpone a reckoning on Donald Trump’s presidency for much longer.
## 14 Welcome to Gem-O-Rama, California’s new gold rush.
## 15 In closed-door testimony, William B. Taylor Jr., implicated President Trump personally in an effort to withhold security aid until Ukraine’s leader agreed to publicly announce investigations of his rivals.
## 16 There were 4,556 allegations in four years, including a rise in complaints during the Trump administration’s family separation policy.
## 17 The agency proposed that surgeons discuss the risks with patients and that manufacturers print bold warnings on the device packaging.
## 18 The No. 2 Pentagon official told Ms. Cooper, the military’s Russia-Ukraine expert, not to talk to Congress. She did anyway.
## 19 Since he started posting videos denouncing corruption in Egypt, Mohamed Ali has set off protests against President Abdel Fattah el-Sisi — and intense speculation about himself.
## 20 Another moment for public protest has arrived.
## results.published_date results.source results.updated
## 1 2019-10-20 The New York Times 2019-10-25 15:55:32
## 2 2019-10-17 The New York Times 2019-10-19 22:11:23
## 3 2019-10-23 The New York Times 2019-10-25 14:03:08
## 4 2019-09-24 The New York Times 2019-10-01 05:00:07
## 5 2019-10-25 The New York Times 2019-10-26 22:20:22
## 6 2019-09-17 The New York Times 2019-09-22 22:45:46
## 7 2019-10-22 The New York Times 2019-10-25 15:55:24
## 8 2019-10-19 The New York Times 2019-10-22 19:56:40
## 9 2019-09-06 The New York Times 2019-09-12 16:18:41
## 10 2019-10-24 The New York Times 2019-10-25 19:18:14
## 11 2019-09-24 The New York Times 2019-09-25 15:01:50
## 12 2019-08-15 The New York Times 2019-08-27 15:43:39
## 13 2019-10-18 The New York Times 2019-10-20 18:05:45
## 14 2019-08-30 The New York Times 2019-09-05 19:32:48
## 15 2019-10-22 The New York Times 2019-10-25 15:55:13
## 16 2019-02-27 The New York Times 2019-06-03 14:35:55
## 17 2019-10-23 The New York Times 2019-10-24 13:20:24
## 18 2019-10-24 The New York Times 2019-10-25 15:55:04
## 19 2019-10-23 The New York Times 2019-10-26 03:28:29
## 20 2019-10-20 The New York Times 2019-10-25 15:46:05
## results.des_facet
## 1 DEMONSTRATIONS, PROTESTS AND RIOTS, POLITICS AND GOVERNMENT, SHORTAGES
## 2 UNITED STATES POLITICS AND GOVERNMENT, UNITED STATES DEFENSE AND MILITARY FORCES, UNITED STATES INTERNATIONAL RELATIONS
## 3 IN VITRO FERTILIZATION, ANXIETY AND STRESS, MENTAL HEALTH AND DISORDERS, INFERTILITY
## 4 ANIMAL BEHAVIOR, CATS, FAMILIES AND FAMILY LIFE, LOVE (EMOTION)
## 5 NEWS AND NEWS MEDIA, TELEVISION, SEX CRIMES
## 6 WORKPLACE ENVIRONMENT, CUSTOMS, ETIQUETTE AND MANNERS, YOUR-FEED-SELFCARE, YOUR-FEED-WORK
## 7 UNITED STATES POLITICS AND GOVERNMENT, THIRD-PARTY POLITICS (US)
## 8 AMUSEMENT AND THEME PARKS, ACCIDENTS AND SAFETY
## 9 LOVE (EMOTION), DATING AND RELATIONSHIPS, PRIVATE AND SECTARIAN SCHOOLS
## 10 RUSSIAN INTERFERENCE IN 2016 US ELECTIONS AND TIES TO TRUMP ASSOCIATES, UNITED STATES POLITICS AND GOVERNMENT, PRESIDENTIAL ELECTION OF 2016
## 11 COOKING AND COOKBOOKS, FAMILIES AND FAMILY LIFE
## 12 PUBLIC SPEAKING, PARTIES (SOCIAL), PSYCHOLOGY AND PSYCHOLOGISTS
## 13 TRUMP-UKRAINE WHISTLE-BLOWER COMPLAINT AND IMPEACHMENT INQUIRY, UNITED STATES POLITICS AND GOVERNMENT
## 14 CRYSTALS, SALT, GEOLOGY, MINES AND MINING
## 15 TRUMP-UKRAINE WHISTLE-BLOWER COMPLAINT AND IMPEACHMENT INQUIRY, UNITED STATES INTERNATIONAL RELATIONS
## 16 SEX CRIMES, CHILD ABUSE AND NEGLECT, ILLEGAL IMMIGRATION, IMMIGRATION AND EMIGRATION
## 17 YOUR-FEED-SCIENCE, IMPLANTS, BREASTS, MEDICAL DEVICES
## 18 UNITED STATES POLITICS AND GOVERNMENT, TRUMP-UKRAINE WHISTLE-BLOWER COMPLAINT AND IMPEACHMENT INQUIRY
## 19 POLITICS AND GOVERNMENT, DEMONSTRATIONS, PROTESTS AND RIOTS, CORRUPTION (INSTITUTIONAL)
## 20 UNITED STATES POLITICS AND GOVERNMENT, TRUMP-UKRAINE WHISTLE-BLOWER COMPLAINT AND IMPEACHMENT INQUIRY
## results.org_facet
## 1 POWER FAILURES AND BLACKOUTS, HOSPITALS, SAINTE CROIX HOSPITAL (LEOGANE, HAITI)
## 2
## 3 PARENTING
## 4 DOGS, ANXIETY AND STRESS, CURRENT BIOLOGY (JOURNAL), OREGON STATE UNIVERSITY
## 5 MSNBC, NBC NEWS, #METOO MOVEMENT, BOOKS AND LITERATURE, SEXUAL HARASSMENT
## 6
## 7 DEMOCRATIC PARTY, PRESIDENTIAL ELECTION OF 2020, PRIMARIES AND CAUCUSES
## 8 DEATHS (FATALITIES), DOCUMENTARY FILMS AND PROGRAMS, ACTION PARK
## 9
## 10 TRUMP-UKRAINE WHISTLE-BLOWER COMPLAINT AND IMPEACHMENT INQUIRY, ESPIONAGE AND INTELLIGENCE SERVICES, SURVEILLANCE OF CITIZENS BY GOVERNMENT, SPECIAL PROSECUTORS (INDEPENDENT COUNSEL), CENTRAL INTELLIGENCE AGENCY, FEDERAL BUREAU OF INVESTIGATION, JUSTICE DEPARTMENT
## 11
## 12 TOASTMASTERS INTERNATIONAL
## 13 REPUBLICAN PARTY, CONSTITUTION (US)
## 14 ROCK AND STONE
## 15 DIPLOMATIC SERVICE, EMBASSIES AND CONSULATES, HOUSE OF REPRESENTATIVES
## 16 UNITED STATES POLITICS AND GOVERNMENT, IMMIGRATION DETENTION, SEXUAL HARASSMENT, REFUGEES AND DISPLACED PERSONS, HEALTH AND HUMAN SERVICES DEPARTMENT, OFFICE OF REFUGEE RESETTLEMENT
## 17 BREAST CANCER, PLASTIC SURGERY, LABELING AND LABELS (PRODUCT), SURGERY AND SURGEONS, SILICONE, AUTOIMMUNE DISEASES, ALLERGAN INC, FOOD AND DRUG ADMINISTRATION
## 18 UNITED STATES DEFENSE AND MILITARY FORCES, DEFENSE DEPARTMENT, HOUSE COMMITTEE ON INTELLIGENCE, IMPEACHMENT
## 19
## 20 PATIENT PROTECTION AND AFFORDABLE CARE ACT (2010), DEMONSTRATIONS, PROTESTS AND RIOTS, POLLS AND PUBLIC OPINION, IMPEACHMENT, DEMOCRATIC PARTY, REPUBLICAN PARTY
## results.per_facet
## 1 MOISE, JOVENEL (1968- )
## 2 TRUMP, DONALD J
## 3
## 4
## 5 MADDOW, RACHEL, FARROW, RONAN, MCHUGH, RICH, OPPENHEIM, NOAH, LACK, ANDREW
## 6
## 7 BIDEN, JOSEPH R JR, WARREN, ELIZABETH, CLINTON, HILLARY RODHAM, BLOOMBERG, MICHAEL R
## 8 PORGES, SETH, SCOTT, CHRIS CHARLES, MULVIHILL, ANDY, MULVIHILL, EUGENE
## 9
## 10 BARR, WILLIAM P, BRENNAN, JOHN O, CLAPPER, JAMES R JR, COMEY, JAMES B, DURHAM, JOHN H, TRUMP, DONALD J
## 11
## 12
## 13 TRUMP, DONALD J, SMITH, MARGARET CHASE
## 14
## 15 TAYLOR, WILLIAM B JR, TRUMP, DONALD J, SONDLAND, GORDON D (1957- ), ZELENSKY, VOLODYMYR
## 16 DEUTCH, TED (1966- )
## 17
## 18 TRUMP, DONALD J, COOPER, LAURA K
## 19 ALI, MOHAMED (ACTIVIST), SISI, ABDEL FATTAH EL-
## 20 TRUMP, DONALD J
## results.geo_facet
## 1 HAITI
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9 ENGLAND
## 10 RUSSIA, UKRAINE
## 11 BANGKOK (THAILAND), GURGAON (INDIA), ROME (ITALY), RIYADH (SAUDI ARABIA), PORT-AU-PRINCE (HAITI), ISRAEL, PARIS (FRANCE), KWAZULU-NATAL PROVINCE (SOUTH AFRICA), AUSTRALIA, LIMA (PERU), AMSTERDAM (NETHERLANDS), TEXAS, LAGOS (NIGERIA), MONTERREY (MEXICO), MOSCOW (RUSSIA), TOKYO (JAPAN), ISTANBUL (TURKEY), SAO PAULO (BRAZIL)
## 12
## 13
## 14 CALIFORNIA, SEARLES LAKE (CALIF)
## 15 UKRAINE
## 16
## 17
## 18 UKRAINE
## 19 EGYPT, BARCELONA (SPAIN)
## 20
## results.media
## 1 image, photo, Protesters last week in Les Cayes, Haiti, surrounded a vehicle that had been burned in a previous demonstration. Impassable roads have contributed to the country’s emergency., Meridith Kohut for The New York Times, 1, https://static01.nyt.com/images/2019/10/17/world/xxhaiti-crisis-promo/xxhaiti-crisis-promo-thumbStandard-v2.jpg, https://static01.nyt.com/images/2019/10/17/world/xxhaiti-crisis-promo/xxhaiti-crisis-promo-mediumThreeByTwo210-v2.jpg, https://static01.nyt.com/images/2019/10/17/world/xxhaiti-crisis-promo/xxhaiti-crisis-promo-mediumThreeByTwo440-v2.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 2 image, photo, , Damon Winter/The New York Times, 1, https://static01.nyt.com/images/2019/10/17/opinion/17mcravenWeb/17mcravenWeb-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/17/opinion/17mcravenWeb/17mcravenWeb-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/17/opinion/17mcravenWeb/17mcravenWeb-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 3 image, photo, , Antoine Maillard, 1, https://static01.nyt.com/images/2019/10/23/multimedia/23-parenting-newsletter-infertility/23-parenting-newsletter-infertility-thumbStandard-v2.jpg, https://static01.nyt.com/images/2019/10/23/multimedia/23-parenting-newsletter-infertility/23-parenting-newsletter-infertility-mediumThreeByTwo210-v2.jpg, https://static01.nyt.com/images/2019/10/23/multimedia/23-parenting-newsletter-infertility/23-parenting-newsletter-infertility-mediumThreeByTwo440-v2.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 4 image, photo, Don’t let their faces fool you. Some cats do seem very bonded to owners, as many cat lovers attest., Thomas Peter/Reuters, 1, https://static01.nyt.com/images/2019/10/01/science/00SCI-CATS1/00SCI-CATS1-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/01/science/00SCI-CATS1/00SCI-CATS1-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/01/science/00SCI-CATS1/00SCI-CATS1-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 5 image, photo, Rachel Maddow, shown in 2017, took on her bosses at NBC News during her MSNBC show on Friday., An Rong Xu for The New York Times, 1, https://static01.nyt.com/images/2019/10/25/business/25maddow2/25maddow2-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/25/business/25maddow2/25maddow2-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/25/business/25maddow2/25maddow2-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 6 image, photo, , Illustration by Shannon Lin/The New York Times, 1, https://static01.nyt.com/images/2019/09/17/fashion/17office-smalltalk-1/17office-smalltalk-1-thumbStandard.jpg, https://static01.nyt.com/images/2019/09/17/fashion/17office-smalltalk-1/17office-smalltalk-1-mediumThreeByTwo210-v2.jpg, https://static01.nyt.com/images/2019/09/17/fashion/17office-smalltalk-1/17office-smalltalk-1-mediumThreeByTwo440-v2.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 7 image, photo, Senator Elizabeth Warren has faced persistent questions about her viability in the general election, and there is concern among some Democrats about her liberal politics., Parker Michels-Boyce for The New York Times, 1, https://static01.nyt.com/images/2019/10/20/us/politics/20democrats-01-promo/20democrats-01-promo-thumbStandard-v3.jpg, https://static01.nyt.com/images/2019/10/20/us/politics/20democrats-01-promo/20democrats-01-promo-mediumThreeByTwo210-v5.jpg, https://static01.nyt.com/images/2019/10/20/us/politics/20democrats-01-promo/20democrats-01-promo-mediumThreeByTwo440-v5.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 8 image, photo, , via Andy Mulvihill, 1, https://static01.nyt.com/images/2019/09/26/nyregion/00actionpark-copy/00actionpark-copy-thumbStandard.jpg, https://static01.nyt.com/images/2019/09/26/nyregion/00actionpark-copy/00actionpark-copy-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/09/26/nyregion/00actionpark-copy/00actionpark-copy-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 9 image, photo, NA, Brian Rea, 1, https://static01.nyt.com/images/2019/09/08/fashion/08MODERNLOVE/merlin_160177641_b1646bfb-c50e-4c55-b998-bda902a1de73-thumbStandard.jpg, https://static01.nyt.com/images/2019/09/08/fashion/08MODERNLOVE/merlin_160177641_b1646bfb-c50e-4c55-b998-bda902a1de73-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/09/08/fashion/08MODERNLOVE/merlin_160177641_b1646bfb-c50e-4c55-b998-bda902a1de73-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 10 image, photo, President Trump has long sought to undermine the Russia investigation, attacking it as a hoax., Anna Moneymaker/The New York Times, 1, https://static01.nyt.com/images/2019/10/24/us/24dc-durham/merlin_163189776_f0d3f5f1-028a-43de-8ad8-7cf2d23dace7-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/24/us/24dc-durham/merlin_163189776_f0d3f5f1-028a-43de-8ad8-7cf2d23dace7-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/24/us/24dc-durham/merlin_163189776_f0d3f5f1-028a-43de-8ad8-7cf2d23dace7-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 11 image, photo, , Andrew Esiebo for The New York Times, 1, https://static01.nyt.com/images/2019/09/25/dining/24World29/24World29-thumbStandard-v2.jpg, https://static01.nyt.com/images/2019/09/25/dining/24World29/24World29-mediumThreeByTwo210-v2.jpg, https://static01.nyt.com/images/2019/09/25/dining/24World29/24World29-mediumThreeByTwo440-v2.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 12 image, photo, , Alex Kiesling, 1, https://static01.nyt.com/images/2019/08/19/smarter-living/19sl_charisma/00sl_charisma-thumbStandard.jpg, https://static01.nyt.com/images/2019/08/19/smarter-living/19sl_charisma/00sl_charisma-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/08/19/smarter-living/19sl_charisma/00sl_charisma-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 13 image, photo, Lindsay Graham, Damon Winter/The New York Times, 1, https://static01.nyt.com/images/2019/10/19/opinion/19gop2/19gop2-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/19/opinion/19gop2/merlin_162866913_bdc0d281-2555-447d-9faa-07b420f5ded6-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/19/opinion/19gop2/merlin_162866913_bdc0d281-2555-447d-9faa-07b420f5ded6-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 14 image, photo, Reeve Peterson, a gem dealer, feels for pink halite crystals at Gem-O-Rama in Trona, Calif., Brian Guido for The New York Times, 1, https://static01.nyt.com/images/2019/08/30/arts/30surfacing-gems1/30surfacing-gems1-thumbStandard.jpg, https://static01.nyt.com/images/2019/08/30/arts/30surfacing-gems1/merlin_158800527_c8fe397c-a5be-4633-85ab-da5372be63f4-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/08/30/arts/30surfacing-gems1/merlin_158800527_c8fe397c-a5be-4633-85ab-da5372be63f4-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 15 image, photo, William B. Taylor Jr., the top American diplomat in Ukraine, leaving Capitol Hill on Tuesday., Erin Schaff/The New York Times, 1, https://static01.nyt.com/images/2019/10/22/us/politics/22dc-impeach4/22dc-impeach4-thumbStandard-v2.jpg, https://static01.nyt.com/images/2019/10/22/us/politics/22dc-impeach4/22dc-impeach4-mediumThreeByTwo210-v2.jpg, https://static01.nyt.com/images/2019/10/22/us/politics/22dc-impeach4/22dc-impeach4-mediumThreeByTwo440-v2.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 16 image, photo, A Justice Department report, released by Representative Ted Deutch, Democrat of Florida, said that there were 4,500 complaints in four years about the sexual harassment and abuse of immigrant children in United States custody., Tom Brenner/The New York Times, 1, https://static01.nyt.com/images/2019/02/28/briefing/28xp-abuse/28xp-abuse-thumbStandard.jpg, https://static01.nyt.com/images/2019/02/28/briefing/28xp-abuse/merlin_135767667_8541bd22-843a-4c6b-a26a-8f32a0a1659b-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/02/28/briefing/28xp-abuse/merlin_135767667_8541bd22-843a-4c6b-a26a-8f32a0a1659b-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 17 image, photo, A textured silicone breast implant linked to a rare form of cancer. The implants have been withdrawn from the market in both Europe and the United States., Alamy, 1, https://static01.nyt.com/images/2019/10/23/science/23IMPLANTS/23IMPLANTS-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/23/science/23IMPLANTS/merlin_158376702_3ab00067-4591-44e2-b450-d3e86c9a6a09-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/23/science/23IMPLANTS/merlin_158376702_3ab00067-4591-44e2-b450-d3e86c9a6a09-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 18 image, photo, Laura Cooper, a Pentagon official, testified to impeachment investigators on Wednesday., Erin Schaff/The New York Times, 1, https://static01.nyt.com/images/2019/10/24/us/politics/24dc-letter/24dc-letter-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/24/us/politics/24dc-letter/merlin_163173315_9f059f58-5b9e-4d98-8ef1-658f80822193-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/24/us/politics/24dc-letter/merlin_163173315_9f059f58-5b9e-4d98-8ef1-658f80822193-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 19 image, photo, Mohamed Ali in Spain, where he lives in self-imposed exile. “Nobody can take out the president in one month,” he said, “but in three or four months, for sure, it can be done.” , Samuel Aranda for The New York Times, 1, https://static01.nyt.com/images/2019/10/22/world/22egypt-spain1/22egypt-spain1-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/22/world/22egypt-spain1/22egypt-spain1-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/22/world/22egypt-spain1/22egypt-spain1-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## 20 image, photo, , Anna Moneymaker/The New York Times, 1, https://static01.nyt.com/images/2019/10/20/opinion/20leonhardt/20leonhardt-thumbStandard.jpg, https://static01.nyt.com/images/2019/10/20/opinion/20leonhardt/20leonhardt-mediumThreeByTwo210.jpg, https://static01.nyt.com/images/2019/10/20/opinion/20leonhardt/20leonhardt-mediumThreeByTwo440.jpg, Standard Thumbnail, mediumThreeByTwo210, mediumThreeByTwo440, 75, 140, 293, 75, 210, 440
## results.uri
## 1 nyt://article/45c49343-4493-5df6-b6aa-88f6316b9a92
## 2 nyt://article/7f06f790-94ce-5960-b3c4-1c231cf94499
## 3 nyt://article/d29713a0-b30d-54bb-b841-6cf5c3e33830
## 4 nyt://article/664e9e01-e89e-5bdd-827e-91c56290f601
## 5 nyt://article/868803d4-a3a4-5c43-b47d-1212c415da4c
## 6 nyt://article/2fdedfb6-ca51-5035-8b75-de59e09e1811
## 7 nyt://article/9472d2df-849b-54ee-963a-1c7685a36304
## 8 nyt://article/bff5e02f-fcb6-50d4-a777-d481305d0009
## 9 nyt://article/5e529e88-926e-5392-bef6-4c7e9c8df405
## 10 nyt://article/ab827704-2086-5a96-aca1-8bc237563de6
## 11 nyt://article/f006b552-5087-5f73-b28f-faa5187c375c
## 12 nyt://article/1068dd6a-3ea9-5538-ae57-7eaf0a3ffdc1
## 13 nyt://article/27ace51e-7134-5fad-a387-076b1052b4af
## 14 nyt://article/8c9391ee-b395-5e2f-980c-3e3a4a8f488a
## 15 nyt://article/a243d828-384a-5be1-b95a-d97018cafd22
## 16 nyt://article/cd876a18-5e8b-566a-97b9-07dc85dde436
## 17 nyt://article/5456c80a-1356-56a5-94d3-8a819f7cc8fd
## 18 nyt://article/2708027b-b620-56c9-99b8-42480618357d
## 19 nyt://article/14812786-1e45-5e68-aba3-444783cab525
## 20 nyt://article/22d5828a-40aa-5bfd-9435-ab35757d081d
# select the columns that we think will help with analysis.
fb_shares <- select(fb_shares, results.subsection, results.share_count, results.section, results.type)
colnames(fb_shares) <- c("sub_section", "share_count", "section", "type")
head(fb_shares)## sub_section share_count section type
## 1 americas 1 World Article
## 2 2 Opinion Article
## 3 3 Parenting Article
## 4 4 Science Article
## 5 5 Business Article
## 6 6 Style Article
## 'data.frame': 20 obs. of 4 variables:
## $ sub_section: chr "americas" "" "" "" ...
## $ share_count: int 1 2 3 4 5 6 7 8 9 10 ...
## $ section : chr "World" "Opinion" "Parenting" "Science" ...
## $ type : chr "Article" "Article" "Article" "Article" ...
theme_set(theme_classic())
ggplot(fb_shares, aes(type, share_count))+
geom_bar(stat="identity", width = 0.5, fill="tomato2")+
theme(axis.text.x=element_text(angle=65, vjust=0.6))theme_set(theme_classic())
ggplot(fb_shares, aes(sub_section, share_count))+
geom_bar(stat="identity", width = 0.5, fill="tomato2")+
theme(axis.text.x=element_text(angle=65, vjust=0.6))We have 20 observations from ny times articles that are shared within the last 7 days in facebook. Not including the blank values under the sub section, we see that political articles are shared the most within the facebook users the most, for the last 7 days.