filmov
tv
Efficient work with RStudio projects and RMarkdown
![preview_player](https://i.ytimg.com/vi/unQfJjhCZ1s/maxresdefault.jpg)
Показать описание
This is an excerpt from my recent presentation on efficient organization and keeping track of project-related files in RStudio, including RMarkdown. See chapters and code below.
00:00 General tips
00:40 RStudio settings
02:42 Create RStudio project
04:04 Project folders, files
06:50 Data loading, save CSV
10:25 Data processing, save RDS or RData
15:03 Load RDS or RData
16:05 Plots for publications vector or raster
21:13 Report in RMarkdown
24:34 R code and output in-line
25:10 Some settings of RMarkdown chunks
R code
## dataraw ----
# Thompson SK. 2012. Sampling. 3rd ed. Wiley.
head(weather)
names(weather) = c("Day", "MaxTemp_C", "MinTemp_C", "MeanTemp_C",
"HDD", "CDD",
"Rain_mm", "Snow_cm", "Precip_mm")
## dataderived ----
summary(D)
D$Snow_mm = D$Snow_cm * 10
summary(D)
saveRDS(D, file = paste0("./dataderived/weather_", Sys.Date(), ".rds"))
# Plots ----
00:00 General tips
00:40 RStudio settings
02:42 Create RStudio project
04:04 Project folders, files
06:50 Data loading, save CSV
10:25 Data processing, save RDS or RData
15:03 Load RDS or RData
16:05 Plots for publications vector or raster
21:13 Report in RMarkdown
24:34 R code and output in-line
25:10 Some settings of RMarkdown chunks
R code
## dataraw ----
# Thompson SK. 2012. Sampling. 3rd ed. Wiley.
head(weather)
names(weather) = c("Day", "MaxTemp_C", "MinTemp_C", "MeanTemp_C",
"HDD", "CDD",
"Rain_mm", "Snow_cm", "Precip_mm")
## dataderived ----
summary(D)
D$Snow_mm = D$Snow_cm * 10
summary(D)
saveRDS(D, file = paste0("./dataderived/weather_", Sys.Date(), ".rds"))
# Plots ----