> I am using ACS micro data (PUMS) with one of the columns as a
> factor for the place of birth (POBPF). I would like to create
> a column (POBR) containing a rank
> corresponding to the place of the observation
> in the POBPF rankings.
I wrote a blog entry on my solution:
http://oregondem
>
> Here's a way to get to your solution, but it's not very pretty:
>
> testdfr <- data.frame(POB=c("Oregon","Oregon","Oregon","New
> York","California","California"))
>
> nstates <- length(unique(testdfr$POB))
> testdfr$ POBR <- c(nstates:1)[table(testdfr$POB)][testdfr$POB]
Hmm I will hav
Here's a way to get to your solution, but it's not very pretty:
testdfr <- data.frame(POB=c("Oregon","Oregon","Oregon","New
York","California","California"))
nstates <- length(unique(testdfr$POB))
testdfr$ POBR <- c(nstates:1)[table(testdfr$POB)][testdfr$POB]
greetings,
Remko
---
Hi all,
I am using ACS micro data (PUMS) with one of the columns as a
factor for the place of birth (POBPF). I would like to create
a column (POBR) containing a rank
corresponding to the place of the observation
in the POBPF rankings. For example,
if a person is from Oregon, Oregon is
the
4 matches
Mail list logo