diff --git a/stocks.txt b/stocks.txt new file mode 100644 index 0000000..d66df24 --- /dev/null +++ b/stocks.txt @@ -0,0 +1,2 @@ +2330 +2454 diff --git a/test-bash.sh b/test-bash.sh new file mode 100644 index 0000000..fa13743 --- /dev/null +++ b/test-bash.sh @@ -0,0 +1 @@ +for i in `seq 1 10`; do echo a$i; done diff --git a/test-dplyr-ggplot2.R b/test-dplyr-ggplot2.R new file mode 100644 index 0000000..b48d4ec --- /dev/null +++ b/test-dplyr-ggplot2.R @@ -0,0 +1,28 @@ +library(readr) +titanic <- read_csv("https://raw.githubusercontent.com/haven-jeon/introduction_to_most_usable_pkgs_in_project/master/bicdata/data/titanic.csv", + col_types = cols(survived = col_character())) + + +library(dplyr) +library(tidyr) +library(magrittr) +library(ggplot2) + +dim(titanic) +titanic %>% dim + +# select sex, count(*) as N from titanic group by sex +titanic %>% group_by(sex) %>% summarise(N=n()) +summarise(group_by(titanic,sex),N=n()) + +# select sex, survived, count(*) as N from titanic group by sex, survived +titanic %>% group_by(sex,survived) %>% summarise(N=n()) + +titanic %>% + ggplot(mapping = aes(x=sex)) + + geom_bar() + facet_grid(survived~pclass) + + +titanic %>% + ggplot(mapping = aes(x=sex,fill=survived)) + + geom_bar() diff --git a/test-get-all-stocks.sh b/test-get-all-stocks.sh new file mode 100644 index 0000000..ea86ef0 --- /dev/null +++ b/test-get-all-stocks.sh @@ -0,0 +1,2 @@ +for stock in $(cat stocks.txt); do STOCK_ID=$stock Rscript.exe test-exe-getStockMajorData.R; done +