Skip to content

Commit

Permalink
Update .Rhistory
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuanchao-Xu committed Apr 3, 2020
1 parent efd0b27 commit eec386a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
hindcast_sorted <- sort(hindcast, decreasing = FALSE, na.last = NA)
# minHindcastPreci is the min preci over threshold FOR ***HINDCAST***
# But use obs to get the lowerIndex, so obs_sorted[lowerIndex + 1] > prThreshold, but
# hindcast_sorted[lowerIndex + 1] may greater than or smaller than ptThreshold
# It would be better to understand if you draw two lines: hindcast_sorted and obs_sorted
# with y = prThreshold, you will find the difference of the two.
# In principle, the value under the threshold needs to be replaced by some other reasonable value.
# simplest way
minHindcastPreci <- hindcast_sorted[lowerIndex + 1]
# Also here if minHindcastPreci is 0 and prThreshold is 0, will cause problem, bettter set
# I set it prThreshold != 0
if (minHindcastPreci <= prThreshold & prThreshold != 0) {
obs_sorted <- sort(obs, decreasing = FALSE, na.last = NA)
# higherIndex is based on hindcast
higherIndex <- which(hindcast_sorted > prThreshold & !is.na(hindcast_sorted))
if (length(higherIndex) == 0) {
higherIndex <- max(which(!is.na(hindcast_sorted)))
higherIndex <- min(length(obs_sorted), higherIndex)
} else {
higherIndex <- min(higherIndex)
}
# here I don't know why choose 6.
# Written # [Shape parameter Scale parameter] in original package
# according to the reference and gamma distribution, at least 6 values needed to fit gamma
# distribution.
Expand Down Expand Up @@ -510,3 +488,25 @@ devtools:check(cran = T)
library(devtools)
devtools::check(cran = T)
devtools::build()
devtools::build()
install.packages('knitr')
devtools::build()
library(hyfo)
?writeNcdf
filePath <- system.file("extdata", "tnc.nc", package = "hyfo")
varname <- getNcdfVar(filePath)
varname
nc <- loadNcdf(filePath, varname)
writeNcdf(nc, 'test.nc')
debug(writeNcdf)
writeNcdf(nc, 'test.nc')
writeNcdf(nc, 'test.nc')
debug(getTimeUnit)
dates
units()
units
time
dates
dates[1]
rem
devtools::build()

0 comments on commit eec386a

Please sign in to comment.