I am relatively inexperience in r and am trying to do work that's relatively simple, but get repeated similar errors. For example, I am working with a dataset and trying to generate a simple crosstabulation of two variables using crosstable in an attached dataset. The dataset was imported from an SPSS .sav file.
crosstable(battle04, region)
Error in crosstable(battle04, region) : 1 assertions failed:
- Variable 'data': Must be of type 'data.frame', not
- 'haven_labelled/vctrs_vctr/double'.
crosstable(abortlaw, region)
Error in crosstable(abortlaw, region) : 1 assertions failed:
- Variable 'data': Must be of type 'data.frame', not 'double'.
This is not the first time I've had an error message along these lines and am perplexed what the problem is.