I'm trying to recode as follows:

X999_4_ethnicities_reclassification$Continent[X999_4_ethnicities_reclassification$Ethnicity_Class == “Brazilian (no ethnicity)”] = “South America”

But I get this error message and can't for the life of me figure out why

Error: unexpected input in "X999_4_ethnicities_reclassification$Continent[X999_4_ethnicities_reclassification$Ethnicity_Class == “"

Does anyone have ideas as to why?

Thanks in advance!

I believe you are intending to build strings, which in R is done with the standard double quote mark, but your example uses a different stylised quote mark 'left double quote'.

34	042	22	00100010	"	"	"	Double quotes (or speech marks)
147	223	93	10010011	“	“	“	Left double quotation mark

source :