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(httr) | |
library(stringr) | |
dat = read.csv("fileWithURLs.csv", stringsAsFactors = F) | |
---------------- for loop to get results ---------------- | |
for (i in 1:nrow(dat)) { | |
a = GET(dat$Current.Forward[i]) | |
dat$URL[i] = a$url |
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
needed = c("lubridate", "dplyr", "data.table", "stringr") | |
is.installed = function(pkg){ | |
is.element(pkg, installed.packages()[,1]) | |
} | |
# For loop to run through each of the packages | |
for (p in 1:length(needed)){ | |
ifelse(!is.installed(needed[p]), install.packages(needed[p], dependencies = T), print(paste(needed[p], " is already installed", sep = ""))) | |
} |
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
needed = c("lubridate", "dplyr", "data.table", "stringr") | |
is.installed <- function(pkg){is.element(pkg, installed.packages()[,1])} | |
for (p in 1:length(needed)){ifelse(!is.installed(needed[p]), install.packages(needed[p], dependencies = T),print(paste(needed[p], " is already installed", sep = "")))} | |
library(lubridate) | |
library(dplyr) | |
library(data.table) #used for the %like% function | |
library(stringr) |
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
haiku = function () { | |
adjs = c( | |
"autumn", "hidden", "bitter", "misty", "silent", "empty", "dry", "dark", | |
"summer", "icy", "delicate", "quiet", "white", "cool", "spring", "winter", | |
"patient", "twilight", "dawn", "crimson", "wispy", "weathered", "blue", | |
"billowing", "broken", "cold", "damp", "falling", "frosty", "green", | |
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old", | |
"red", "rough", "still", "small", "sparkling", "throbbing", "shy", | |
"wandering", "withered", "wild", "black", "young", "holy", "solitary", | |
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine", |
NewerOlder