-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_one_to_one()
errors with duplicated dttm
#543
Comments
get_one_to_one()
errors with dttmget_one_to_one()
errors with duplicated dttm
Thanks for reporting this. It does appear to be an error in the code, but I can't reproduce it because I don't have your |
Hi, here is a the reproducible example (with dput) dates <- structure(list(modification_time = structure(c(1684261364.85967,
1684274880.48328, 1684261364.85967, 1684418379.74664, 1685105253.21695,
1684418379.76668, 1684279133.50118, 1684161951.81434, 1684281651.93175,
1678483898.72893, 1685103626.03424), class = c("POSIXct", "POSIXt"
)), access_time = structure(c(1685040222.34459, 1685041485.59089,
1685105067.68569, 1685040222.51569, 1685105253.21795, 1685105067.73877,
1685105253.66953, 1685106417.48391, 1685105253.66853, 1685041485.59089,
1685103652.82275), class = c("POSIXct", "POSIXt")), change_time = structure(c(1684261364.85967,
1684274880.48328, 1684261364.85967, 1684418379.74664, 1685105253.21695,
1684418379.76668, 1684279133.50118, 1684161951.81434, 1684281651.93175,
1678483898.72893, 1685103626.03424), class = c("POSIXct", "POSIXt"
))), row.names = c(NA, -11L), class = c("tbl_df", "tbl", "data.frame"
))
janitor::get_one_to_one(dates)
Error in `levels<-`(`*tmp*`, value = as.character(levels)) :
factor level [5] is duplicated |
The underlying issue is unusual here. What is happening is that the times with 5 decimal place precision differ but when converted by factor, they lose that precision and become the same. |
…e identical factor levels (fix #543)
thanks for reporting this @olivroy and for fixing @billdenney ! |
Please briefly describe your problem and what output you expect.
Created on 2023-05-26 with reprex v2.0.2
This only seems to occur with duplicated dates, in this case with columns at position 5, 16, 17.
The text was updated successfully, but these errors were encountered: