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
Using GERMAPARLMINI in polmineR v0.8.8.9010 I observed the following unexpected behaviour:
When applying s_attributes() with more than one s-attribute to subcorpora with only one cpos pair, the returned data.table does not have correct column names.
Expected would be a data.table with the column names "speaker" and "party". But the return value is a data.table with the column names "V1" and "V2".
After looking at s_attributes.R, I think the issue is that subcorpora with a single cpos pair (or partitions which behave the same) are treated differently from subcorpora with more than one cpos pair, thus losing the name of the s-attributes in the process. This is the part of the code I looked at:
If there is only one cpos pair, the tab_data object, which still contains the correct names, is turned into a matrix object first which does not have the column names anymore.
Using the dimnames argument of matrix() might be a solution here since tab_data could provide column names.
The text was updated successfully, but these errors were encountered:
Using GERMAPARLMINI in
polmineR v0.8.8.9010
I observed the following unexpected behaviour:When applying
s_attributes()
with more than one s-attribute to subcorpora with only one cpos pair, the returned data.table does not have correct column names.Take the following example:
Expected would be a data.table with the column names "speaker" and "party". But the return value is a data.table with the column names "V1" and "V2".
After looking at s_attributes.R, I think the issue is that subcorpora with a single cpos pair (or partitions which behave the same) are treated differently from subcorpora with more than one cpos pair, thus losing the name of the s-attributes in the process. This is the part of the code I looked at:
polmineR/R/s_attributes.R
Lines 287 to 290 in db73937
If there is only one cpos pair, the
tab_data
object, which still contains the correct names, is turned into a matrix object first which does not have the column names anymore.Using the
dimnames
argument ofmatrix()
might be a solution here sincetab_data
could provide column names.The text was updated successfully, but these errors were encountered: