Skip to content

Commit

Permalink
bug fixed for multiplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuanchao-Xu committed Nov 27, 2015
1 parent c931020 commit 770b827
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 31 deletions.
8 changes: 4 additions & 4 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
versionLine <- updatesLine + 2
version <- unlist(strsplit(page[versionLine], split = ' '))[2]
version_local <- packageDescription("hyfo")$Version
# the first tow digit is the most important part of the version
version12 <- unlist(strsplit(version, split = "[.]"))[1:2]
version_local12 <- unlist(strsplit(version_local, split = "[.]"))[1:2]
sameVersion <- version12 == version_local12
Expand Down Expand Up @@ -510,3 +506,7 @@ devtools::install_github('Yuanchao-Xu/hyfo')
library(hyfo)
?getBiasFactor
?getPreciBar
devtools::build()
devtools::document()
devtools::check()
devtools::build()
2 changes: 1 addition & 1 deletion .Rproj.user/D53FD3E6/pcs/find-in-files.pper
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"filePatterns" : [
],
"path" : "E:/1/R/hyfo/R",
"query" : "sixto",
"query" : "choose.dir",
"regex" : false
}
}
2 changes: 1 addition & 1 deletion .Rproj.user/D53FD3E6/pcs/source-pane.pper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"activeTab" : 2
"activeTab" : 4
}
6 changes: 3 additions & 3 deletions .Rproj.user/D53FD3E6/sdb/per/t/222F1822
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"contents" : "hyfo 1.3.2\n==========\nDate: 2015.11.7\n\n- bug fixed about getPreciBar, signature('data.frame')\n- vignettes updated about bug and hided the warning information.\n- Add how to debug in the documentation for the generic functions.\n\n\n\nhyfo 1.3.1\n==========\nDate: 2015.11.3\n\n- new generic function biasCorrect, extractPeriod, resample, getAnnual, getPreciBar added. No need to designate input type any more, R will detect automatically.\n- coordinates conversion function extracted.\n- new user manual about real time bias correction and resample added.\n\n\n\nhyfo 1.2.9\n==========\nDate: 2015.10.30\n\n- new biasFactor S4 class added, to avoid set the input type every time.\n- operational bias correction has been changed to generic function.\n- news file added.\n\n\n\nhyfo 1.2.8\n==========\nDate: 2015.10.10\n\n- operational bias correction added, in normal function.",
"contents" : "hyfo 1.3.3\n==========\nDate: 2015.11.27\n\n- Delete readData_folder, since it's only windows based, add information to get special \nversion for windows users.\n\n\n\nhyfo 1.3.2\n==========\nDate: 2015.11.7\n\n- bug fixed about getPreciBar, signature('data.frame')\n- vignettes updated about bug and hided the warning information.\n- Add how to debug in the documentation for the generic functions.\n\n\n\nhyfo 1.3.1\n==========\nDate: 2015.11.3\n\n- new generic function biasCorrect, extractPeriod, resample, getAnnual, getPreciBar added. No need to designate input type any more, R will detect automatically.\n- coordinates conversion function extracted.\n- new user manual about real time bias correction and resample added.\n\n\n\nhyfo 1.2.9\n==========\nDate: 2015.10.30\n\n- new biasFactor S4 class added, to avoid set the input type every time.\n- operational bias correction has been changed to generic function.\n- news file added.\n\n\n\nhyfo 1.2.8\n==========\nDate: 2015.10.10\n\n- operational bias correction added, in normal function.",
"created" : 1446423165783.000,
"dirty" : false,
"encoding" : "ASCII",
"folds" : "",
"hash" : "1093548842",
"hash" : "4069467791",
"id" : "222F1822",
"lastKnownWriteTime" : 1446982013,
"lastKnownWriteTime" : 1448662584,
"path" : "E:/1/R/hyfo/NEWS",
"project_path" : "NEWS",
"properties" : {
Expand Down
17 changes: 17 additions & 0 deletions .Rproj.user/D53FD3E6/sdb/per/t/95008D35
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"contents" : "\nreadData_folder <- function(folderName, keyword) {\n \n folderName <- paste(folderName, keyword, sep = '\\\\')\n \n fileNames <- list.files(folderName, pattern = '*.csv', full.names = TRUE)\n \n if (length(fileNames)==0) {\n fileNames <- list.files(folderName, pattern = '.TXT', full.names = TRUE)\n if (length(fileNames)==0) stop('Wrong keyword, initial has to be Upper-case')\n \n data <- collectData_txt_anarbe(folderName, rangeWord = c('D?a ', -1, 'M?x. ', -5))\n rownames(data) <- NULL\n } else {\n data <- collectData_csv_anarbe(folderName)\n }\n \n return(data)\n}\n\n\n# @importFrom utils choose.dir\n#' @references \n#' \n#' \\itemize{\n#' \\item R Core Team (2015). R: A language and environment for statistical computing. R Foundation for\n#' Statistical Computing, Vienna, Austria. URL http:https://www.R-project.org/.\n#' }\n#' \n\nreadData <- function(keyword, folderName) {\n message('This function is only windows based, if you are using windows platform (real\n operational system, not virtual machine), and want to use this function, please\n contact the author ([email protected]) for the windows version.')\n# message('Choose the main folder that, in it, there are different folders representing different gauging stations,\n# all the gauging stations have precipitation data, some of them also have discharge data,\n# this function is to open different gauging folders and read the data, arragen them together.')\n# message('\\n\\n\n# new file is a list based file and needs to be read by dget()')\n \n# fileNames <- list.files(folderName, full.names = TRUE)\n# data <- lapply(fileNames, FUN = readData_folder, keyword = keyword)\n# \n# names <- sapply(c(1:length(data)), function(x) colnames(data[[x]])[2])\n# names(data) <- names\n# \n# fileName <- file.choose(new = TRUE)\n# dput(data, file = fileName)\n# \n# return(data)\n}\n",
"created" : 1448656365859.000,
"dirty" : false,
"encoding" : "ASCII",
"folds" : "",
"hash" : "637518556",
"id" : "95008D35",
"lastKnownWriteTime" : 1448662415,
"path" : "E:/1/R/hyfo/R/readfolders.R",
"project_path" : "R/readfolders.R",
"properties" : {
},
"relative_order" : 8,
"source_on_save" : false,
"type" : "r_source"
}
6 changes: 3 additions & 3 deletions .Rproj.user/D53FD3E6/sdb/per/t/B74937DD
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"contents" : "Package: hyfo\nType: Package\nTitle: Hydrology and Climate Forecasting R Package for Data Analysis and\n Visualization\nVersion: 1.3.2\nDate: 2015-11-3\nAuthors@R: person(\"Yuanchao\", \"Xu\", email = \"[email protected]\",\n role = c(\"aut\", \"cre\"))\nDescription: This package focuses on data processing and visulization in hydrology and \n climate forecasting. Main function includes data extraction, data downscaling, data resampling,\n gap filler of precipitation, bias correction of forecasting data, flexible time series plot, \n and spatial map generation. It is a good pre-processing and post-processing tool for hydrological\n and hydraulic modellers.\nLicense: GPL-2\nDepends:\n R (>= 3.1.0),\n stats (>= 3.1.3),\n utils(>= 3.1.3),\nImports:\n ggplot2 (>= 1.0.1),\n reshape2 (>= 1.4.1),\n zoo (>= 1.7-12),\n rgdal (>= 0.9-3),\n plyr (>= 1.8.3),\n moments (>= 0.14),\n lmom (>= 2.5),\n maps(>= 2.3-9),\n maptools (>= 0.8-36),\n rgeos (>= 0.3-8),\n ncdf (>= 1.6.8),\n MASS (>= 7.3-39),\n methods\nSuggests:\n gridExtra,\n knitr\nVignetteBuilder: knitr\nLazyData: true\nURL: http:https://yuanchao-xu.github.io/hyfo/\nBugReports: https://github.com/Yuanchao-Xu/hyfo/issues\nrepository: github\n",
"contents" : "Package: hyfo\nType: Package\nTitle: Hydrology and Climate Forecasting R Package for Data Analysis and\n Visualization\nVersion: 1.3.3\nDate: 2015-11-3\nAuthors@R: person(\"Yuanchao\", \"Xu\", email = \"[email protected]\",\n role = c(\"aut\", \"cre\"))\nDescription: This package focuses on data processing and visulization in hydrology and \n climate forecasting. Main function includes data extraction, data downscaling, data resampling,\n gap filler of precipitation, bias correction of forecasting data, flexible time series plot, \n and spatial map generation. It is a good pre-processing and post-processing tool for hydrological\n and hydraulic modellers.\nLicense: GPL-2\nDepends:\n R (>= 3.1.0),\n stats (>= 3.1.3),\n utils(>= 3.1.3),\nImports:\n ggplot2 (>= 1.0.1),\n reshape2 (>= 1.4.1),\n zoo (>= 1.7-12),\n rgdal (>= 0.9-3),\n plyr (>= 1.8.3),\n moments (>= 0.14),\n lmom (>= 2.5),\n maps(>= 2.3-9),\n maptools (>= 0.8-36),\n rgeos (>= 0.3-8),\n ncdf (>= 1.6.8),\n MASS (>= 7.3-39),\n methods\nSuggests:\n gridExtra,\n knitr\nVignetteBuilder: knitr\nLazyData: true\nURL: http:https://yuanchao-xu.github.io/hyfo/\nBugReports: https://github.com/Yuanchao-Xu/hyfo/issues\nrepository: github\n",
"created" : 1446423221493.000,
"dirty" : false,
"encoding" : "ASCII",
"folds" : "",
"hash" : "241325119",
"hash" : "771317259",
"id" : "B74937DD",
"lastKnownWriteTime" : 1448455593,
"lastKnownWriteTime" : 1448662593,
"path" : "E:/1/R/hyfo/DESCRIPTION",
"project_path" : "DESCRIPTION",
"properties" : {
Expand Down
2 changes: 2 additions & 0 deletions .Rproj.user/D53FD3E6/sdb/prop/A2C3F18D
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
1 change: 1 addition & 0 deletions .Rproj.user/D53FD3E6/sdb/prop/INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ E%3A%2F1%2FR%2Fhyfo%2FR%2Fmulti-biasCorrect(generic).R="EA14EE46"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fmulti-biasCorrect.R="60922670"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fmulti_biasCorrect(generic).R="FF40DCF8"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fncdf.R="990A4302"
E%3A%2F1%2FR%2Fhyfo%2FR%2Freadfolders.R="A2C3F18D"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fresample(generic).R="24F549E6"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fresample.R="6A40A26"
E%3A%2F1%2FR%2Fhyfo%2FR%2Fshp2cat.R="8ACB3251"
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: hyfo
Type: Package
Title: Hydrology and Climate Forecasting R Package for Data Analysis and
Visualization
Version: 1.3.2
Version: 1.3.3
Date: 2015-11-3
Authors@R: person("Yuanchao", "Xu", email = "[email protected]",
role = c("aut", "cre"))
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ importFrom(stats,qgamma)
importFrom(stats,quantile)
importFrom(stats,rgamma)
importFrom(stats,var)
importFrom(utils,choose.dir)
importFrom(utils,combn)
importFrom(utils,packageDescription)
importFrom(utils,read.csv)
Expand Down
9 changes: 9 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
hyfo 1.3.3
==========
Date: 2015.11.27

- Delete readData_folder, since it's only windows based, add information to get special
version for windows users.



hyfo 1.3.2
==========
Date: 2015.11.7
Expand Down
37 changes: 20 additions & 17 deletions R/readfolders.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ readData_folder <- function(folderName, keyword) {
}


#' @importFrom utils choose.dir
# @importFrom utils choose.dir
#' @references
#'
#' \itemize{
Expand All @@ -29,20 +29,23 @@ readData_folder <- function(folderName, keyword) {
#'

readData <- function(keyword, folderName) {
message('Choose the main folder that, in it, there are different folders representing different gauging stations,
all the gauging stations have precipitation data, some of them also have discharge data,
this function is to open different gauging folders and read the data, arragen them together.')
message('\n\n
new file is a list based file and needs to be read by dget()')

fileNames <- list.files(folderName, full.names = TRUE)
data <- lapply(fileNames, FUN = readData_folder, keyword = keyword)

names <- sapply(c(1:length(data)), function(x) colnames(data[[x]])[2])
names(data) <- names

fileName <- file.choose(new = TRUE)
dput(data, file = fileName)

return(data)
message('This function is only windows based, if you are using windows platform (real
operational system, not virtual machine), and want to use this function, please
contact the author ([email protected]) for the windows version.')
# message('Choose the main folder that, in it, there are different folders representing different gauging stations,
# all the gauging stations have precipitation data, some of them also have discharge data,
# this function is to open different gauging folders and read the data, arragen them together.')
# message('\n\n
# new file is a list based file and needs to be read by dget()')

# fileNames <- list.files(folderName, full.names = TRUE)
# data <- lapply(fileNames, FUN = readData_folder, keyword = keyword)
#
# names <- sapply(c(1:length(data)), function(x) colnames(data[[x]])[2])
# names(data) <- names
#
# fileName <- file.choose(new = TRUE)
# dput(data, file = fileName)
#
# return(data)
}

0 comments on commit 770b827

Please sign in to comment.