gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

stri_datetime_format/parse not vectorised wrt format #434

Closed gagolews closed 3 years ago

gagolews commented 3 years ago

But strptime/strftime has: The usual vector re-cycling rules are applied to 'x' and 'format' so the answer will be of length of the longer of these vectors.

gagolews commented 3 years ago

Also, stri__prepare_arg_string_1_notNA does not re-encode strings, this should be fixed

$ grep src  -FIrine stri__prepare_arg_string_1_notNA
src/stri_time_calendar.cpp:96:    const char* units_val = stri__prepare_arg_string_1_notNA(units, "units");
src/stri_time_symbols.cpp:56:    const char* context_str = stri__prepare_arg_string_1_notNA(context, "context");
src/stri_time_symbols.cpp:60:    const char* width_str = stri__prepare_arg_string_1_notNA(width, "width");
src/stri_stringi.h:70:const char* stri__prepare_arg_string_1_notNA(SEXP x,  const char* argname);
src/stri_time_zone.cpp:175:    const char* dtype_str = stri__prepare_arg_string_1_notNA(display_type, "display_type"); /* this is R_alloc'ed */
src/stri_time_format.cpp:60:    const char* format_val = stri__prepare_arg_string_1_notNA(format, "format");
src/stri_time_format.cpp:222:    const char* format_val = stri__prepare_arg_string_1_notNA(format, "format");
src/stri_prepare_arg.cpp:1172:const char* stri__prepare_arg_string_1_notNA(SEXP x, const char* argname)