From 1477e288e25629cc1d045458f139be34849975c8 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 27 Apr 2020 14:13:43 -0400 Subject: [PATCH] R notes --- jupyter/r.md | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/jupyter/r.md b/jupyter/r.md index 3153ff1..eed553d 100644 --- a/jupyter/r.md +++ b/jupyter/r.md @@ -1,10 +1,34 @@ -using grid.arrange -https://cran.r-project.org/web/packages/gridExtra/vignettes/arrangeGrob.html - -set and mirror axis limits: -``` -scale_y_continuous( - breaks=seq(glob$PriceMin, glob$PriceMax, round(glob$StdDev * .5,2)), - limits = c(glob$PriceMin, glob$PriceMax) - ) + +using grid.arrange +https://cran.r-project.org/web/packages/gridExtra/vignettes/arrangeGrob.html + +set and mirror axis limits: +``` +scale_y_continuous( + breaks=seq(glob$PriceMin, glob$PriceMax, round(glob$StdDev * .5,2)), + limits = c(glob$PriceMin, glob$PriceMax) + ) + +``` + +how to loop through rows of a column +``` +for (i in dim1) { + for (j in i) { + print(j); + } +} +``` + +build a list of plots and use grid.arrange +``` +do.call(grid.arrange,plot_list) +``` + +re-sort a dataframe and print each row of a column +``` +dim1 <- dim1[order(dim1$list),]; +for (i in dim1) { + for (j in i) { + print(j); + } +} ``` \ No newline at end of file