Skip to content

Commit

Permalink
Merge pull request #12 from sahilseth/devel
Browse files Browse the repository at this point in the history
bump version, and ready for CRAN
  • Loading branch information
sahilseth committed Apr 19, 2016
2 parents 7627fc9 + 688a9df commit 5c38906
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
README.html
README.Rmd
^cran-comments\.md$

cran-comments.md
params.Rproj
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Title: Simplify Parameters
Description: An interface to simplify organizing parameters used in a package,
using external configuration files. This attempts to provide a cleaner
alternative to options().
Version: 0.5.0
Version: 0.6.1
Depends:
R (>= 3.0.2),
whisker
Expand All @@ -20,4 +20,4 @@ Authors@R: c(
)
URL: https://github.com/sahilseth/params
BugReports: https://github.com/sahilseth/params/issues
RoxygenNote: 5.0.1.9000
RoxygenNote: 5.0.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ S3method(print,knitr_kable)
S3method(print,opts)
export(.load_opts)
export(check_args)
export(fix_names)
export(get_opts)
export(kable)
export(load_opts)
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
p a r a m s 0.6.0
------------------------------------------------
- `read_sheet`, now recognizes `.mat` as a tsv

p a r a m s 0.5.0
------------------------------------------------
- get_opts output is fully compatible with getOption
- `get_opts` output is fully compatible with getOption
- output is a un-named vector, for variable length = 1

p a r a m s 0.4.0
------------------------------------------------
- updated documentation for read_sheet
- write_sheet now handles multiple extensions
- `write_sheet` now handles multiple extensions

p a r a m s 0.3.0 2015/09/22
------------------------------------------------
Expand Down
19 changes: 19 additions & 0 deletions R/fix-names.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' fix_names
#'
#' Replace special characters in column names of a data.frame
#'
#' @param x a vector of column names
#' @param char substitute special char with this.
#'
#' @export
#'
#' @seealso make.names
#'
fix_names <- function (x, char = "."){

y <- gsub("_", char, as.character(x))
y <- gsub(" ", char, as.character(y))
y <- gsub("\\.", char, as.character(y))

return(y)
}
2 changes: 1 addition & 1 deletion R/read-sheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ read_sheet <- function(x, id_column, start_row = 1, sheet = 1, ext, header=TRUE,
mat = mat[,!grepl("^X", colnames(mat))]

}else{
stop("Sorry read_shet does not recognize this file format: ", ext, " please use tsv, csv or xlsx (sheetname: sample_sheet)")
stop("Sorry read_sheet does not recognize this file format: ", ext, " please use tsv, csv or xlsx (sheetname: sample_sheet)")
}

### ------ remove blank rows and columns
Expand Down
2 changes: 1 addition & 1 deletion R/write-sheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ write_sheet <- function(x, file, ext, ...){

dir.create(dirname(file), recursive = TRUE, showWarnings=FALSE)

if(ext %in% c("tsv", "txt", "conf", "def")){
if(ext %in% c("tsv", "txt", "conf", "def", "mat")){
write.table(x = x, file = file, sep = "\t", row.names = FALSE, quote = FALSE, ...)

}else if(ext=="csv"){
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

p a r a m s
------------------


[![Build Status](https://travis-ci.org/sahilseth/params.svg)](https://travis-ci.org/sahilseth/params)
[![](http://www.r-pkg.org/badges/version/params)](http://cran.rstudio.com/web/packages/params/index.html)
[![](http://www.r-pkg.org/badges/version/params)](https://cran.r-project.org/package=params)
![](http://cranlogs.r-pkg.org/badges/grand-total/params)

**[sahilseth.github.io/params](http://sahilseth.github.io/params)**
Expand Down
11 changes: 8 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Test environments
* local OS X install, R 3.2.2
* ubuntu 12.04 (on travis-ci), R 3.2.2
* local OS X install, R 3.2.4
* ubuntu 12.04 (on travis-ci), R 3.2.4
* win-builder (release)
* Rdevel version using rocker/r-devel


## Downstream dependencies
Expand All @@ -10,7 +11,11 @@
of params.


<!---notes to self:
## checklist for self
- check rerevdep_check()
- check revdep_check()
- version in DESCRIPTION (3)
- update NEWS
--->
20 changes: 20 additions & 0 deletions man/fix_names.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c38906

Please sign in to comment.