[![GitHub commits since tagged version](https://img.shields.io/github/commits-since/adityatelange/hugo-PaperMod/r readLines(".git/modules/themes/PaperMod/refs/heads/master")
?style=flat&logo=github&label=Commits%20since%20last%20theme%20submodule%20pull)](https://github.com/adityatelange/hugo-PaperMod/compare/`r readLines(".git/modules/themes/PaperMod/refs/heads/master")`...master)
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
template.Rproj | |
template.html | |
*_files/ | |
*_cache/ |
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
if (interactive()) { | |
suppressMessages(require(usethis)) | |
} | |
if (interactive()) { | |
suppressMessages(require(devtools)) | |
} | |
if (interactive()) { | |
suppressMessages(require(cput)) |
expand
stuff
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
# Sort all columns alphabetically | |
dat <- dat[,order(colnames(dat))] | |
dat <- dat %>% select(sort(current_vars())) # Alternatively | |
# Reorder each column alphabetically | |
dat <- map_df(dat, function(x) {sort(x, na.last = TRUE)}) |
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
add_tweet_count <- function(dat) { | |
return( | |
dat %>% | |
group_by(user_id) %>% | |
mutate( | |
tweet_count = n() | |
) %>% | |
ungroup() # to remove grouped_df class | |
) | |
} |
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
dat <- dat %>% | |
rowwise() %>% | |
mutate(bundesland = unlist(bundesland), | |
community = unlist(community), | |
fach = unlist(fach)) %>% | |
ungroup() # important to remove rowwise_df class! (slows down all other operations) |
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
# Mutate numeric (0 / 1) coded columns to logical | |
dat <- s1 %>% | |
mutate(across(where(is.numeric), as.logical)) |
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
dat %>% select_if(is.list) |
NewerOlder