-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c931020
commit 770b827
Showing
12 changed files
with
62 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
"filePatterns" : [ | ||
], | ||
"path" : "E:/1/R/hyfo/R", | ||
"query" : "sixto", | ||
"query" : "choose.dir", | ||
"regex" : false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"activeTab" : 2 | ||
"activeTab" : 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" : { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ readData_folder <- function(folderName, keyword) { | |
} | ||
|
||
|
||
#' @importFrom utils choose.dir | ||
# @importFrom utils choose.dir | ||
#' @references | ||
#' | ||
#' \itemize{ | ||
|
@@ -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) | ||
} |