Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Commit d7c7c11

Browse files
committed
Switch to POSIXct
Fixes #5
1 parent 3530cef commit d7c7c11

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

R/query.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @param sparql_query SPARQL query (can be a vector of queries)
44
#' @param format "simple" uses CSV and returns pure character data frame, while
55
#' "smart" fetches JSON-formatted data and returns a data frame with datetime
6-
#' columns converted to `POSIXlt`
6+
#' columns converted to `POSIXct`
77
#' @param ... Additional parameters to supply to [httr::GET()]
88
#' @return A `data.frame`
99
#' @examples
@@ -20,7 +20,7 @@
2020
#' query_wikidata(sparql_query)
2121
#'
2222
#' \dontrun{
23-
#' # "smart" format converts all datetime columns to POSIXlt
23+
#' # "smart" format converts all datetime columns to POSIXct
2424
#' query_wikidata(sparql_query, format = "smart")
2525
#' }
2626
#' @export
@@ -71,7 +71,7 @@ query_wikidata <- function(sparql_query, format = c("simple", "smart"), ...) {
7171
}, FALSE)
7272
if (any(datetime_cols)) {
7373
for (datetime_col in which(datetime_cols)) {
74-
df[[datetime_col]] <- as.POSIXlt(df[[datetime_col]], format = "%Y-%m-%dT%H:%M:%SZ", tz = "GMT")
74+
df[[datetime_col]] <- as.POSIXct(df[[datetime_col]], format = "%Y-%m-%dT%H:%M:%SZ", tz = "GMT")
7575
}
7676
}
7777
message(nrow(df), " rows were returned by WDQS")

man/query_wikidata.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)