Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fact2num

Converts "numeric" factor levels to numeric values.


Description

Converts “numeric” factor levels to numeric values.

Usage

fact2num(object)

Arguments

object

A vector with “numeric” factor levels to be converted to numeric values.

Value

A numeric vector.

Author(s)

Derek H. Ogle, derek@derekogle.com

Examples

junk <- factor(c(1,7,2,4,3,10))
str(junk)
junk2 <- fact2num(junk)
str(junk2)

## ONLY RUN IN INTERACTIVE MODE
if (interactive()) {

bad <- factor(c("A","B","C"))
# This will result in an error -- levels are not 'numeric'
bad2 <- fact2num(bad)

}  ## END IF INTERACTIVE MODE

FSA

Simple Fisheries Stock Assessment Methods

v0.8.32
GPL (>= 2)
Authors
Derek Ogle [aut, cre] (<https://orcid.org/0000-0002-0370-9299>), Powell Wheeler [aut], Alexis Dinno [aut] (Provided base functionality of dunnTest())
Initial release
2021-1-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.