toB64

Everything related to the development of modules in jamovi
Post Reply
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

toB64

Post by mcfanda@gmail.com »

Studying jmvcore I see that factors are preprocessed using toB64 function. In a module I'm developing, however, I got this:

# levels(dat$wfac)
[1] "0" "1"

jmvcore::toB64(levels(dat$wfac))

"MA" "MQ"

What is the purpose of preprocessing factor levels like this. Is there a guideline or can we skip iin module development?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: toB64

Post by jonathon »

hey mcfanda,

some R packages don't like column names/levels with special characters or spaces in them. so if you pass them through 'as-is', the results you get back will be all weird. so it's for working around bugs in upstream packages.

so if the upstream packages work fine, then you don't need to use base 64 encoding. but if it's an issue we try these:

a) report the issue to the upstream package maintainer (and he fixes it)
b) submit a PR to the upstream package fixing the issue
c) work around the upstream package issue by converting the names to/from base64

cheers
Post Reply