Running examples in ‘HiClimR-Ex.R’ failed
The error most likely occurred in:

> ### Name: HiClimR2nc
> ### Title: Export NetCDF-4 file for Hierarchical Climate Regionalization
> ### Aliases: HiClimR2nc
> ### Keywords: HiClimR
> 
> ### ** Examples
> 
> require(HiClimR)
> require(ncdf4)
Loading required package: ncdf4
> 
> ## Load test case data
> x <- TestCase$x
> 
> ## Generate longitude and latitude mesh vectors
> xGrid <- grid2D(lon = unique(TestCase$lon), lat = unique(TestCase$lat))
> lon <- c(xGrid$lon)
> lat <- c(xGrid$lat)
> 
> ## Hierarchical Climate Regionalization
> y <- HiClimR(x, lon = lon, lat = lat, lonStep = 1, latStep = 1, geogMask = FALSE,
+     continent = "Africa", meanThresh = 10, varThresh = 0, detrend = TRUE,
+     standardize = TRUE, nPC = NULL, method = "ward", hybrid = FALSE,
+     kH = NULL, members = NULL, validClimR = TRUE, k = 12, minSize = 1,
+     alpha = 0.01, plot = TRUE, colPalette = NULL, hang = -1, labels = FALSE)

PROCESSING STARTED

Checking Multivariate Clustering (MVC)...
---> x is a matrix
---> single-variate clustering: 1 variable
Checking data...
---> Checking dimensions...
---> Checking row names...
---> Checking column names...
Data filtering...
---> Computing mean for each row...
---> Checking rows with mean bellow meanThresh...
---> 4678 rows found, mean ≤  10
---> Computing variance for each row...
---> Checking rows with near-zero-variance...
---> 3951 rows found, variance ≤  0
Data preprocessing...
---> Applying mask...
---> Checking columns with missing values...
---> Removing linear trend...
---> Standardizing data...
Agglomerative Hierarchical Clustering...
---> Computing correlation/dissimilarity matrix...
---> Starting clustering process...
---> Constructing dendrogram tree...
dev.new(): using pdf(file="Rplots2.pdf")
Calling cluster validation...
---> Computing cluster means...
---> Computing inter-cluster correlations...
---> Computing intra-cluster correlations...
---> Computing summary statistics...
Generating region map...
dev.new(): using pdf(file="Rplots3.pdf")

PROCESSING COMPLETED

Running Time:
   user  system elapsed 
  1.843   0.070   2.778 
Time difference of 2.778337 secs
> 
> ## Export region map and mean timeseries into NetCDF-4 file
> HiClimR2nc(y=y, ncfile="HiClimR.nc", timeunit="years", dataunit="mm")
Error in R_nc4_create: Permission denied (creation mode was 4096)
Error in nc_create(ncfile, list(region.def, timeseries.def), force_v4 = TRUE) : 
  Error in nc_create!
Calls: HiClimR2nc -> nc_create
Execution halted