mirror of
https://github.com/agdamsbo/daDoctoR.git
synced 2024-11-21 11:20:23 +01:00
new small function
This commit is contained in:
parent
e10228bdec
commit
18b387ce14
@ -1,6 +1,6 @@
|
||||
Package: daDoctoR
|
||||
Title: Functions For Health Research
|
||||
Version: 0.19.13
|
||||
Version: 0.19.14
|
||||
Year: 2019
|
||||
Author: Andreas Gammelgaard Damsbo <agdamsbo@pm.me>
|
||||
Maintainer: Andreas Gammelgaard Damsbo <agdamsbo@pm.me>
|
||||
|
@ -31,3 +31,4 @@ export(strobe_diff_twodim)
|
||||
export(strobe_log)
|
||||
export(strobe_olr)
|
||||
export(strobe_pred)
|
||||
export(substrRight)
|
||||
|
16
R/substrRight.R
Normal file
16
R/substrRight.R
Normal file
@ -0,0 +1,16 @@
|
||||
#' Substring n last characters
|
||||
#'
|
||||
#'
|
||||
#' @param x vector
|
||||
#' @param n number of string elements to
|
||||
#' @keywords substr
|
||||
#' @export
|
||||
#' @examples
|
||||
#' ##Kim Larsen
|
||||
#' cpr<-"231045-0637"
|
||||
#' substrRight(cpr,4)
|
||||
|
||||
substrRight <- function(x, n){
|
||||
r<-nchar(x)
|
||||
substr(x, r-n+1, r)
|
||||
}
|
22
man/substrRight.Rd
Normal file
22
man/substrRight.Rd
Normal file
@ -0,0 +1,22 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/substrRight.R
|
||||
\name{substrRight}
|
||||
\alias{substrRight}
|
||||
\title{Substring n last characters}
|
||||
\usage{
|
||||
substrRight(x, n)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{vector}
|
||||
|
||||
\item{n}{number of string elements to}
|
||||
}
|
||||
\description{
|
||||
Substring n last characters
|
||||
}
|
||||
\examples{
|
||||
##Kim Larsen
|
||||
cpr<-"231045-0637"
|
||||
substrRight(cpr,4)
|
||||
}
|
||||
\keyword{substr}
|
Loading…
Reference in New Issue
Block a user