Subset on ltm_cronbach_alph
Thomas Friedrichsmeier
thomas.friedrichsmeier at kdemail.net
Thu Jul 28 13:51:06 BST 2022
Hi,
Am Thu, 28 Jul 2022 07:06:54 -0500
schrieb DES Alfonso Cano Robles <alfonsociologo at gmail.com>:
> Hi all.
> I just wanted to comment on an issue in the item response theory
> plugin when subsetting a data frame.
> I think it's related to the file:
>
> /rkward/plugins/analysis/irt/tests/ltm_cronbach_alpha.js
>
>
> Specifically with lines:
>
> // reformat inp_items
>
> > 17 if (inp_items)
> > 18 inp_items = inp_items.replace(/\n/g,',
> > ').replace(/(\w*)\[\[|\]\]/g, '' );
>
>
> // The "((/\w*)/g" argument is not enough to replace the name of a
> data frame like "data.frame" or "my.data.r" which returns a "syntax
> error". Short work around by changing the name of the data frame to
> not using period(s) (".") (or any special characters). I've explored
> a few solutions using regex with no satisfactory success as for
> limiting the result only to the name of the data frame.
Thanks! Fixed. (Although I would not be surprised, if there are more
places where a similar fix is needed).
That code was pretty ancient, no regular expression wrangling is needed:
https://invent.kde.org/education/rkward/commit/c25922ce23c3381fd31878332a5338c889a0634b
Importantly, getList() allows to retrieve list values as an array, and
the modifier ".shortname" extracts the column name, reliably.
Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://mail.kde.org/pipermail/rkward-users/attachments/20220728/ad401cb3/attachment.sig>
More information about the rkward-users
mailing list