Closed tgravelle closed 1 year ago
Hello! Where do you get your data from? Which function do you use to load the data? Could you apply the function below to your dataset? It will detect factors with duplicated levels:
dupl_levels = function(df){
res = lapply(df, attr, 'levels')
dupl_levels = sapply(res, anyDuplicated)
res[dupl_levels>0]
}
And could you try to detect the column which caused the error? To do this you need to remove variables from your code for the table one by one and find after which variable the code will stop raising an error.
Thank you for your reply. I'm reading in an SPSS .sav dataset exported from IncQuery using haven::read_sav(). I've previously done the same with .sav files from other sources without issue. Your function does not identify any duplicated factor levels in my data (it returns a list of length 0).
I also have no way of reliably determining which column is throwing an error because the error occurs intermittently: the same code will sometimes run and sometimes not not run -- without making any changes to the code.
Could you provide the result of str
on each variable which is used in your code for the table?
The same as #107.
Could you run the sessionInfo()
on your system and place the results here?
The same as #107. Closed as duplicated.
Hello!
In using expss to tabulate survey data, I am receiving the error message below intermittently. By "intermittent" I mean that when this error occurs, I can simply re-run the example code (also below) and often obtain the desired tabulation. For context, all of the columns in data.2 being tabulated are factors (I am not at liberty to share the data).
This is rather a strange behavior that I haven't encountered with expss before. Why would unchanged code produce varying results -- sometimes returning an error message and sometimes returning the desired tabulation?
Thank you in advance for any insight on what might be causing this.