pageview_timestamps: Validate and convert time objects to function with pageviews...

View source: R/timestamps.R

pageview_timestampsR Documentation

Validate and convert time objects to function with pageviews functions

Description

pageview_timestamps converts Date and POSIXlt and ct objects to work nicely with the start and end parameters in pageviews functions.

Usage

pageview_timestamps(timestamps = Sys.Date(), first = TRUE)

Arguments

timestamps

a vector of character, Date, POSIXlt or POSIXct objects.

first

whether to, if timestamps is of date objects, assume the first hour in a day (TRUE) or the last (FALSE). TRUE by default.

Value

a character vector containing timestamps that can be used with article_pageviews et al.

See Also

article_pageviews and project_pageviews, where you can make use of this function.

Examples

# Using a Date
pageview_timestamps(Sys.Date())

# Using a POSIXct object
pageview_timestamps(Sys.time())

# Validate a character string
pageview_timestamps("2016020800")


Ironholds/pageviews documentation built on March 7, 2024, 10:43 a.m.