Sfoglia il codice sorgente

better default simplification of tweets columns

master
Garrick Aden-Buie 6 anni fa
parent
commit
17e10f27a3
2 ha cambiato i file con 27 aggiunte e 26 eliminazioni
  1. +1
    -1
      DESCRIPTION
  2. +26
    -25
      R/tweet_io.R

+ 1
- 1
DESCRIPTION Vedi File

Package: gathertweet Package: gathertweet
Title: Gather Tweets from the Command Line with rtweet Title: Gather Tweets from the Command Line with rtweet
Version: 0.0.1.9000
Version: 0.0.1.9001
Authors@R: Authors@R:
person(given = "Garrick", person(given = "Garrick",
family = "Aden-Buie", family = "Aden-Buie",

+ 26
- 25
R/tweet_io.R Vedi File

if (length(.fields)) { if (length(.fields)) {
tweets %>% dplyr::select(!!!.fields) tweets %>% dplyr::select(!!!.fields)
} else { } else {
dplyr::select(
tweets,
created_at,
status_id,
user_id,
screen_name,
text,
is_quote,
is_retweet,
favorite_count,
retweet_count,
hashtags,
profile_url,
profile_image_url,
urls_expanded_url,
mentions_screen_name,
media_url,
urls_url,
ext_media_url,
status_url,
dplyr::starts_with("reply_to_"),
quoted_status_id,
retweet_status_id,
quoted_status_id,
dplyr::starts_with("mentions_"),
tw_cols <- names(tweets)
keep_cols <- c(
"created_at",
"status_id",
"user_id",
"screen_name",
"text",
"is_quote",
"is_retweet",
"favorite_count",
"retweet_count",
"hashtags",
"profile_url",
"profile_image_url",
"urls_expanded_url",
"mentions_screen_name",
"media_url",
"urls_url",
"ext_media_url",
"status_url",
grep("^reply_to_", tw_cols, value = TRUE),
"quoted_status_id",
"retweet_status_id",
"quoted_status_id",
grep("^mentions_", tw_cols, value = TRUE)
) )
tweets[, intersect(tw_cols, keep_cols)]
} }
} }



Loading…
Annulla
Salva