Skip to content

Commit

Permalink
First commitment
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack-83 committed Jul 12, 2018
0 parents commit 307dfdc
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
11 changes: 11 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: maRgheRitaR
Type: Package
Title: What the Package Does (Title Case)
Version: 0.1.0
Author: Who wrote it
Maintainer: The package maintainer <[email protected]>
Description: More about what it does (maybe more than one line)
Use four spaces when indenting paragraphs within the Description.
License: What license is it under?
Encoding: UTF-8
LazyData: true
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exportPattern("^[[:alpha:]]+")
17 changes: 17 additions & 0 deletions R/center.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#' Centering datasets
#'
#' Some more description
#'
#' And even more
#'
#' @param dataset The numeric vector to be centered
#' @param desired The numeric midpoint value around which the data will be centered
#'
#' @return A new vector containing the original data centered around the desired values
#'
#' @examples
# center(c(1,2,3),0) # should return -1 0 1
# center(c(4,5,6),2) # should return 1 2 3
center <- function(dataset, desired) {
dataset - mean(dataset) + desired
}
12 changes: 12 additions & 0 deletions R/rescale.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#' Rescaling datasets
#'
#' @param v A numeric vector
#'
#' @return A new numeric vector, rescaled from the input vector to the range of 0 to 1
#'
#' @examples
#' rescale(c(1,2,3)) # [1] 0.0 0.5 1.0
#' rescale(c(1,2,3,4,5)) # [1] 0.00 0.25 0.50 0.75 1.00
rescale <- function(v) {
(v - min(v)) / (max(v) - min(v))
}
20 changes: 20 additions & 0 deletions maRgheRitaR.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source

0 comments on commit 307dfdc

Please sign in to comment.