mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 12:37:30 +02:00
new working version with major updates
This commit is contained in:
parent
fb2569c647
commit
e4633421aa
16 changed files with 1678 additions and 85 deletions
55
man/cut.Rd
Normal file
55
man/cut.Rd
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/cut-variable-dates.R
|
||||
\name{cut.hms}
|
||||
\alias{cut.hms}
|
||||
\alias{cut.POSIXt}
|
||||
\alias{cut.POSIXct}
|
||||
\alias{cut.Date}
|
||||
\title{Title}
|
||||
\usage{
|
||||
\method{cut}{hms}(x, breaks, ...)
|
||||
|
||||
\method{cut}{POSIXt}(
|
||||
x,
|
||||
breaks,
|
||||
right = FALSE,
|
||||
include.lowest = TRUE,
|
||||
start.on.monday = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
\method{cut}{POSIXct}(
|
||||
x,
|
||||
breaks,
|
||||
right = FALSE,
|
||||
include.lowest = TRUE,
|
||||
start.on.monday = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
\method{cut}{Date}(x, breaks, start.on.monday = TRUE, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{an object inheriting from class "POSIXct"}
|
||||
|
||||
\item{...}{passed on}
|
||||
}
|
||||
\value{
|
||||
factor
|
||||
}
|
||||
\description{
|
||||
Title
|
||||
}
|
||||
\examples{
|
||||
readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "08:20:20", "21:20:20", "03:02:20")) |> cut(2)
|
||||
readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "08:20:20", "21:20:20", "03:02:20")) |> cut("min")
|
||||
readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "08:20:20", "21:20:20", "03:02:20")) |> cut(breaks = "hour")
|
||||
readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "08:20:20", "21:20:20", "03:02:20")) |> cut(breaks = hms::as_hms(c("01:00:00", "03:01:20", "9:20:20")))
|
||||
d_t <- readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "03:02:20", NA))
|
||||
f <- d_t |> cut(2)
|
||||
readr::parse_time(c("01:00:20", "03:00:20", "01:20:20", "03:02:20", NA)) |> cut(breaks = lubridate::as_datetime(c(hms::as_hms(levels(f)), hms::as_hms(max(d_t, na.rm = TRUE) + 1))), right = FALSE)
|
||||
readr::parse_datetime(c("1992-02-01 01:00:20", "1992-02-06 03:00:20", "1992-05-01 01:20:20", "1992-09-01 08:20:20", "1999-02-01 21:20:20", "1992-12-01 03:02:20")) |> cut(2)
|
||||
readr::parse_datetime(c("1992-02-01 01:00:20", "1992-02-06 03:00:20", "1992-05-01 01:20:20", "1992-09-01 08:20:20", "1999-02-01 21:20:20", "1992-12-01 03:02:20")) |> cut(breaks="weekday")
|
||||
as.Date(c("1992-02-01 01:00:20", "1992-02-06 03:00:20", "1992-05-01 01:20:20", "1992-09-01 08:20:20", "1999-02-01 21:20:20", "1992-12-01 03:02:20")) |> cut(2)
|
||||
as.Date(c("1992-02-01 01:00:20", "1992-02-06 03:00:20", "1992-05-01 01:20:20", "1992-09-01 08:20:20", "1999-02-01 21:20:20", "1992-12-01 03:02:20")) |> cut(breaks="weekday")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue