library(tidymodels)
car_rec <- recipe(~ ., data = mtcars) %>%
step_normalize(disp, qsec)
car_prep <- prep(car_rec)
juice(car_prep)
#> # A tibble: 32 x 11
library(rsample)
library(tidyverse)
library(palmerpenguins)
data("penguins")
penguins %>%
count(species)
#> # A tibble: 3 x 2
#> species n
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://github.com/rfordatascience/tidytuesday/blob/master/data/2020/2020-06-23/readme.md | |
library(tidyverse) | |
library(bcmaps) | |
locations <- read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-06-23/locations.csv') | |
locations_sf <- locations %>% | |
select(animal_id, longitude, latitude) %>% | |
st_as_sf(coords = c("longitude", "latitude")) %>% | |
st_set_crs(4326) %>% | |
transform_bc_albers() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(tidylo) | |
library(babynames) | |
top_names <- babynames %>% | |
filter(year >= 1950, | |
year < 1990) %>% | |
mutate(decade = (year %/% 10) * 10, | |
decade = paste0(decade, "s")) %>% | |
group_by(decade) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(rtweet) | |
potus <- get_timeline("realDonaldTrump", n = 3200) | |
potus %>% | |
transmute(creation_date = as.Date(created_at), | |
text = str_remove_all(text, "https://t.co/[A-Za-z\\d]+"), | |
exclamations = str_extract_all(text, "\\!"), | |
exclamations = map_int(exclamations, length), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(tidytext) | |
dat <- tibble( | |
a = c("row1", "row1", "row2", "row2", "row2"), | |
b = c("col1", "col2", "col1", "col3", "col4"), | |
val = 1:5 | |
) | |
d <- cast_dtm(dat, a, b, val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidytext) | |
library(widyr) | |
library(igraph) | |
library(ggraph) | |
words_cooccur <- tidy_words %>% | |
group_by(word) %>% | |
filter(n() > 250) %>% | |
ungroup() %>% | |
pairwise_cor(word, Respondent, sort = TRUE, upper = FALSE) %>% |
I hereby claim:
- I am juliasilge on github.
- I am juliasilge (https://keybase.io/juliasilge) on keybase.
- I have a public key ASDmuxcJrM55BGKWGxCENIRSHvzgkeXqhw61aiiVwcqMPQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## this analysis assumes a dataframe `post_views` with columns: | |
## PostId | |
## CreationDate | |
## Tag | |
## AnswerCount | |
## ViewCount | |
library(tidyverse) | |
post_views %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(scales) | |
theme_set(silgelib::theme_plex()) | |
library(geniusR) | |
library(tidytext) | |
albums <- tibble(artist = rep("The Beatles", 13), | |
album = c("Please Please Me", | |
"With the Beatles", | |
"A Hard Day's Night", |