Skip to content

Commit

Permalink
minor bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brasmus committed Nov 8, 2023
1 parent 0e0a916 commit caf4dba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ocdp/app/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ vari2name <- function(x,vars=c('pre','t2m','tmax','tmin',
'Global Radiation','Humidity'),nc=3) {
print(paste('<D: vari2name',x,collapse=' '))
x <- sub('slp','pp',x)
x <- sub('precip','rr',x)
x <- sub('precip','pre',x)
if (length(vars) != length(vnames)) {
print(vars); print(vnames)
stop("vars have different length to vnames in 'variname'")
}
y <- vnames[match(x,vars)]
y <- vnames[match(tolower(substr(x,1,4)),vars)]
print(paste(y,'...D>',collapse=' '))
return(y)
}
Expand Down
4 changes: 2 additions & 2 deletions ocdp/app/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ server <- function(input, output, session) {
print('<17: reactive - updateci()')
varids <- updatevarids()
ci <- 1:length(varids); names.ci <- names(varids)
## In case the vairable is missing in our list
names.ci[is.na(names.ci)] <- toupper(varids[is.na(names.ci)])
## In case the variable is missing in our list
names.ci[is.na(names.ci)] <- vari2name(varids[is.na(names.ci)])
#print(names.ci)
names(ci) <- names.ci
return(ci)
Expand Down

0 comments on commit caf4dba

Please sign in to comment.