# DESCRIPTION
``````
Package: packageSkeleton
Version: 0.0-0.1
Date: 2024-10-14
Title: A GitHub repository featuring a starter template for R package development, paired with a Quarto-powered website
Description: The packageSkeleton R package provides a comprehensive template to jumpstart the development of an R package, complete with a structured framework for coding, documentation, and version control. It simplifies the process of setting up an R package repository on GitHub, offering built-in integration with Quarto for generating a professional, customizable website to showcase package documentation and vignettes. This template is designed to help both new and experienced R developers streamline package creation while ensuring best practices in documentation and collaboration. With minimal setup, users can focus on building and sharing valuable tools within the R ecosystem.
Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="dbetebenner@nciea.org", role=c("aut", "cre"),
comment = c(ORCID = "0000-0003-0476-5599")),
person(given=c("Adam", "R."), family="Van Iwaarden", email="avaniwaarden@nciea.org", role="aut"))
Maintainer: Damian W. Betebenner <dbetebenner@nciea.org>
Depends: R (>= 4.0)
Suggests: knitr, rmarkdown
Imports: crayon, testthat, toOrdinal
URL: https://CenterForAssessment.github.io/packageSkeleton
BugReports: https://github.com/CenterForAssessment/packageSkeleton/issues
VignetteBuilder: knitr
LazyData: Yes
LazyDataCompression: xz
LazyLoad: Yes
ByteCompile: TRUE
License: MIT + file LICENSE
Encoding: UTF-8
``````
# `Hello_World`: Hello World Sample Dataset
## Description
The `Hello_World` dataset provides a simple example with greetings in different languages, useful for illustrating basic data frame operations in R.
## Usage
``````r
Hello_World
``````
## Format
A data frame with 10 rows and 2 variables:
* `Language`: A character vector indicating the language of the Hello World greeting.
* `Hello_World_Greeting`: A character vector containing the word "Hello" in different languages.
## Source
Manually created for demonstration purposes.
## Examples
``````r
# Display the hello_world dataset
Hello_World
# Access the greeting column
Hello_World$Hello_World_Greeting
# Access the language column
Hello_World$Language
``````
# `packageSkeleton-package`: A GitHub repository featuring a starter template for R package development, paired with a Quarto-powered website.
## Description
The packageSkeleton R package provides a comprehensive template to jumpstart the development of an R package, complete with a structured framework for coding, documentation, and version control. It simplifies the process of setting up an R package repository on GitHub, offering built-in integration with Quarto for generating a professional, customizable website to showcase package documentation and vignettes. This template is designed to help both new and experienced R developers streamline package creation while ensuring best practices in documentation and collaboration. With minimal setup, users can focus on building and sharing valuable tools within the R ecosystem.
## Keyword
package
## Details
| | |
|---------|---------------|
|Package: |packageSkeleton|
|Type: |Package |
|Version: |0.0-0.1 |
|Date: |2024-10-14 |
|License: |GPL-3 |
|LazyLoad:|yes |
## Author
Damian W. Betebenner [DBetebenner@nciea.org](mailto:DBetebenner@nciea.org)
# `strHead`: Returns the first `n` characters of a string, with support for negative values.
## Description
The `strHead` function extracts the first `n` characters of a provided string. If `n_char` is positive, it returns the first `n_char` characters; if negative, it returns all but the last `abs(n_char)` characters. The function handles input validation, ensuring that `n_char` is within the bounds of the string length. It's useful for quickly trimming strings to desired lengths.
## Usage
``````r
strHead(
string,
n_char=1)
``````
## Arguments
* `string`: Character string or vector of character strings.
* `n_char`: Number of characters to take from the head (starting at the first character) of the string (or vector of strings). A positive value returns the first `n_char` characters, while a negative value removes the last `abs(n_char)` characters from the end. Defaults to 1.
## Keyword
misc
## Keyword
models
## Details
The `strHead` function is typically used to extract the first few characters from a character string or each string in a vector of character strings. This can be useful for truncating strings or extracting prefixes. The function supports both positive and negative values for `n_char`, allowing flexible string extraction. For positive values, the function returns the first `n_char` characters, while for negative values, it returns all but the last `abs(n_char)` characters.
## Author
Damian W. Betebenner [dbetebenner@nciea.org](mailto:dbetebenner@nciea.org)
## Value
The function returns a character string or a vector of character strings, depending on the input. The output consists of the first `n_char` characters from each string in the input. If `n_char` is negative, the result excludes the last `abs(n_char)` characters from each string.
## Examples
``````r
# Example 1: First two characters of each state name
strHead(state.name, 2)
# Example 2: First three characters of a single string
strHead("California", 3)
# Example 3: Remove the last two characters from each string in a vector
strHead(c("apple", "banana", "cherry"), -2)
# Example 4: Get the first character of each month name
strHead(month.name, 1)
# Example 5: Handle a vector of different length strings
strHead(c("wolf", "elephant", "giraffe"), 4)
``````
# `strTail`: Returns the last `n` characters of a string, with support for negative values.
## Description
The `strTail` function extracts the last `n` characters of a provided string. If `n_char` is positive, it returns the last `n_char` characters; if negative, it returns all but the first `abs(n_char)` characters. The function handles input validation, ensuring that `n_char` is within the bounds of the string length. It's useful for quickly trimming strings to desired lengths.
## Usage
``````r
strTail(
string,
n_char=1)
``````
## Arguments
* `string`: Character string or vector of character strings.
* `n_char`: Number of characters to take from the tail (starting at the last character) of the string (or vector of strings). A positive value returns the last `n_char` characters, while a negative value removes the first `abs(n_char)` characters from the start. Defaults to 1.
## Keyword
misc
## Keyword
models
## Details
The `strTail` function is commonly used to extract the last few characters from a character string or each string in a vector of character strings. This is helpful when you need to retrieve suffixes or the end portion of strings. The function supports both positive and negative values for `n_char`. For positive values, the function returns the last `n_char` characters, while for negative values, it excludes the first `abs(n_char)` characters from the start of each string.
## Author
Damian W. Betebenner [dbetebenner@nciea.org](mailto:dbetebenner@nciea.org)
## Value
The function returns a character string or a vector of character strings, depending on the input. The output consists of the last `n_char` characters from each string in the input. If `n_char` is negative, the result excludes the first `abs(n_char)` characters from each string.
## Examples
``````r
# Example 1: Last two characters of each state name
strTail(state.name, 2)
# Example 2: Last three characters of a single string
strTail("California", 3)
# Example 3: Remove the first two characters from each string in a vector
strTail(c("apple", "banana", "cherry"), -2)
# Example 4: Get the last character of each month name
strTail(month.name, 1)
# Example 5: Handle a vector of different length strings
strTail(c("wolf", "elephant", "giraffe"), 4)
``````
Reference
Function Reference
Below is the list of functions available in the packageSkeleton
package.