MattCowgill / strayr

R package with historical Australian data and useful wrangling functions
10 stars 1 forks source link

Add state_code conversion #3

Closed wfmackey closed 5 years ago

wfmackey commented 5 years ago

@MattCowgill this is still my favourite package on the Internet.

Can you/I add numeric state code conversion (from the ABS)

1 = NSW
2 = Vic
3 = Qld
4 = SA
5 = WA
6 = Tas
7 = NT
8 = ACT
9 = Other

THANKS

MattCowgill commented 5 years ago

yes but I'm gonna drop "Other"

wfmackey commented 5 years ago

Yeah cool sure just override the ABS.

MattCowgill commented 5 years ago

done. Note that if you're converting to code, the results will be a character vector ("1", not 1). If you're converting from code it can be either numeric or character, as in strayr(c(1, 2)) or strayr(c("1", "2"))