R notes
This commit is contained in:
parent
0c3234c920
commit
1477e288e2
24
jupyter/r.md
24
jupyter/r.md
@ -8,3 +8,27 @@ scale_y_continuous(
|
|||||||
limits = c(glob$PriceMin, glob$PriceMax)
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user