How to deal with "ERROR: Can't combine" when using Stata data read into R with haven?

72 views Asked by At

I am having trouble working with Stata data that I have read into R. The data seems to be read in okay, and then is a tbl data.frame haven data class. However, when I try to do things like subset it, I get an error. Can anybody help?

data <- read_stata("/Users/..../Desktop/SOM.dta") 
data_stockholm <- subset(data, areg == "1")
Error: Can't combine `..1` <character> and `..2` <double>.
Run `rlang::last_error()` to see where the error occurred.
0

There are 0 answers