This file contains hidden or 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
for file in *.txt; do split -l 1 -d --additional-suffix=${${file}%.*}_$(uuidgen).xml $file;done | |
# split by size | |
split -b 256M --additional-suffix=.csv myfile.csv splitted_ | |
# split 5 parts taking lines | |
split --number=l/5 inputfile outputprefix --additional-suffix=.csv | |
#split keeping header | |
tail -n +2 operate.csv | split -l 2 - --filter='sh -c "{ head -n1 operate.csv; cat; } > $FILE"' |
This file contains hidden or 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
# Your first question was to customize the tooltip so it displays | |
# some of the variables in the dataset (including those not mapped to aesthetics). | |
# In your UPDATE#3 you introduce:text = paste("Province:", NAME_1) into your aes. | |
# If you want to add a second line of custom variables or text, just keep adding it into the | |
# brackets:text = paste("Province:", NAME_1, "Example III:", example1) | |
# | |
# To add a line break between both add <br> in the spot where you want the break to be, like: | |
text = paste("Province:", NAME_1, "<br>", "Example III:", example1) |
This file contains hidden or 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
labs <- lapply(seq(nrow(df)), function(i) { | |
paste0( "<font color='purple'>",df[i, "nombre"], ', ', | |
df[i, "provincia"], '</font></br>', | |
"(", | |
round(df[i, "coord_lat"],2),' / ', | |
round(df[i, "coord_lon"],2), | |
")") | |
}) |
This file contains hidden or 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
z7path = shQuote('C:\\Program Files\\7-Zip\\7z') | |
cmd <- paste(z7path, ' e ', rarfile, ' -ir!*.* -o', '"', temp_folder, '"', sep='') | |
system(cmd) |
This file contains hidden or 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
knitr::spin() # to Rmd | |
knitr::curl() # to Rscript | |
rmarkdown::render("analysis.R") # to html | |
rmarkdown::render("analysis.R", "pdf_document") # to pdf |
This file contains hidden or 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) | |
allmypackages <- as.data.frame(installed.packages()) | |
allmypackages <- allmypackages %>% | |
filter(Priority != "base" | is.na(Priority)) %>% | |
select(-c(Enhances:MD5sum, LinkingTo:Suggests)) %>% | |
droplevels() | |
package_source <- function(pkg){ | |
x <- as.character(packageDescription(pkg)$Repository) | |
if (length(x)==0) { |
This file contains hidden or 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
update.packages(checkBuilt = T, ask = F, repos = "http://cran.rstudio.com/") |
This file contains hidden or 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(purrr) | |
ans <- map_df(past_earnings_lists, ~as.data.frame(.x), .id="id") |
This file contains hidden or 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
from bs4 import BeautifulSoup | |
with open("feeds.opml") as data: | |
soup = BeautifulSoup(data.read(), "lxml") | |
for feed in soup.find_all("outline"): | |
print(f"** [[{feed.get('xmlurl')}][{feed.get('text')}]]") |
This file contains hidden or 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
"setup vim-plug {{{ | |
"Note: install vim-plug if not present | |
if empty(glob('~/.config/nvim/autoload/plug.vim')) | |
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall | |
endif | |
"Note: Skip initialization for vim-tiny or vim-small. | |
if !1 | finish | endif |