You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#584 added strL usage when a string is longer than 2045 characters:
write_dta() now uses strL when strings are too long to be stored in an str# variable (write_dta support for long string (strL)? #437). strL is used when strings are longer than 2045 characters by default, which matches Stata's behaviour, but this can be reduced with the strl_threshold argument.
This works for a character vector without missing values:
However it errors when there is a missing value in the character vector:
library(haven)
packageVersion("haven")
#> [1] '2.5.4.9000'dest<- tempfile(fileext=".dta")
dat<-data.frame(x= c("a", NA, strrep("a", 2046)))
### <--------------------------------added a missing value
write_dta(dat, dest)
#> Error: Failed to insert value [2, 1]: The provided value was not a valid string reference.
#584 added
strLusage when a string is longer than 2045 characters:This works for a character vector without missing values:
However it errors when there is a missing value in the character vector:
Session info