Skip to content

Commit

Permalink
added script
Browse files Browse the repository at this point in the history
  • Loading branch information
stineb committed May 1, 2024
1 parent fdd1d41 commit 237af6d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R-proj-template.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
24 changes: 24 additions & 0 deletions analysis/make_tidy_cmip6.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
library(map2tidy)
library(dplyr)
library(ggplot2)

# list demo file path
path <- "/data/scratch/CMIP6ng/cmip6-ng/pr/day/native/"

## Precipitation ---------------
files <- list.files(path, pattern = "pr_day", full.names = TRUE)

# load and convert
df <- map2tidy(
nclist = files,
varnam = "pr",
lonnam = "lon",
latnam = "lat",
timenam = "time",
timedimnam = "time",
do_chunks = TRUE,
outdir = "/data/scratch/CMIP6ng/cmip6_tidy/",
fileprefix = "pr_day_CESM2_historical_r1i1p1f1_native"
)


0 comments on commit 237af6d

Please sign in to comment.