Commit de8eff3d authored by Jean-Marie Lepioufle's avatar Jean-Marie Lepioufle
Browse files

remove as_tbl_basic

parent 50130858
#' as_tbl_basic
#' as_tbl_basic
#' @param df data.frame
#' @param group group character
#' @keywords basicr
#' @export
#' @examples
#' \dontrun{
#' as_tbl_basic()
#' }
as_tbl_basic <- function(df,group){
res <- tibble::as_tibble(df)
names(res) <- switch(group,
"none" = c("n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"YEAR" = c("YEAR","n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"MONTH" = c("MONTH","n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"WDAY" = c("WDAY" ,"n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"HOUR" = c("HOUR" ,"n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"MINUTE" = c("MINUTE" ,"n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
"SECOND" = c("SECOND" ,"n","q0","q1","q2","q3","q4","IQR","m","sd","cv"),
stop("group not recognized"))
if (group=="YEAR"){res$YEAR <- factor(res$YEAR, levels = res$YEAR)}
if (group=="MONTH"){res$MONTH <- factor(res$MONTH, levels = res$MONTH)}
if (group=="WDAY") {res$WDAY <- factor(res$WDAY, levels = res$WDAY)}
if (group=="HOUR") {res$HOUR <- factor(res$HOUR, levels = res$HOUR)}
if (group=="MINUTE") {res$MINUTE <- factor(res$MINUTE, levels = res$MINUTE)}
if (group=="SECOND") {res$SECOND <- factor(res$SECOND, levels = res$SECOND)}
class(res) <- c("tbl_basic",class(res))
return(res)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_tbl_basic.R
\name{as_tbl_basic}
\alias{as_tbl_basic}
\title{as_tbl_basic
as_tbl_basic}
\usage{
as_tbl_basic(df, group)
}
\arguments{
\item{df}{data.frame}
\item{group}{group character}
}
\description{
as_tbl_basic
as_tbl_basic
}
\examples{
\dontrun{
as_tbl_basic()
}
}
\keyword{basicr}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment