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
> # generate text for txt file | |
> lipsum <- function() paste(sample(letters, runif(1, 3, 10)), collapse = "") | |
> lipsum_lines <- function() paste0(paste(replicate(10, lipsum()), collapse = " "), "\n") | |
> | |
> # create txt file | |
> cat(replicate(100, lipsum_lines()), file = "splitxt.txt") | |
> | |
> # read n lines from txt file | |
> spltxt <- readLines("splitxt.txt", n = 50) | |
> spltxt[1:5] |
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 function is now included in the development version | |
## of rtweets. install instructions can be found on the | |
## package readme (or my github rtweet repo) | |
## Read in the following functions | |
save_as_csv <- function(x, file_name) { | |
if (missing(file_name)) { | |
stop("must provide file_name.", call. = FALSE) | |
} |
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
lite.as.feather <- function(path){ | |
data <- read.csv(path) | |
newpath <- paste0(sub(".csv", "", path), ".feather") | |
feather::write_feather(data, newpath) | |
} |
NewerOlder