Skip to content
Snippets Groups Projects
Commit 90cd9660 authored by Walmes Zeviani's avatar Walmes Zeviani
Browse files

Move examples to the correct place.

parent 3a80cc60
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,16 @@ ...@@ -28,6 +28,16 @@
#' #'
#' @examples #' @examples
#' #'
#' a <- data.frame(
#' Species=as.character(sample(iris$Species, size=10, replace=TRUE)),
#' stringsAsFactors=FALSE)
#' str(a)
#'
#' levels(a$Species)
#' levels(iris$Species)
#'
#' b <- equalizeLevels(target=a, ref=iris)
#' str(b)
#' #'
equalizeLevels <- function(target, ref){ equalizeLevels <- function(target, ref){
if(is.data.frame(target) & is.data.frame(ref)){ if(is.data.frame(target) & is.data.frame(ref)){
...@@ -41,14 +51,3 @@ equalizeLevels <- function(target, ref){ ...@@ -41,14 +51,3 @@ equalizeLevels <- function(target, ref){
} }
else stop("`target` and `ref` must be a data.frame.") else stop("`target` and `ref` must be a data.frame.")
} }
a <- data.frame(
Species=as.character(sample(iris$Species, size=10, replace=TRUE)),
stringsAsFactors=FALSE)
str(a)
levels(a$Species)
levels(iris$Species)
b <- equalizeLevels(target=a, ref=iris)
str(b)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment