rio icon indicating copy to clipboard operation
rio copied to clipboard

rio export fails for duration variable with label attribute, haven-export works

Open hsbizahlenzauber opened this issue 2 weeks ago • 4 comments

MWE

rio export fails for duration variable with label attribute, haven-export works

library("lubridate") library("rio") library("haven")

#creating a variable of class period

duration <- seconds_to_period(duration(hours=26000))

#creating data frame

data <- data.frame(duration)

#setting variable label as attribute #without this attribute, everything works as expected attr(data$duration, "label") <- "Duration"

#export with haven #no error message haven::write_sav(data, path="testHAVEN.sav")

#export with rio #Error in new_labelled(): #! x must be a numeric or a character vector. rio::export(data, file="testRIO.sav")

hsbizahlenzauber avatar Jun 17 '24 13:06 hsbizahlenzauber