Re: [R] Error: variable not found

2020-10-30 Thread Jim Lemon
Hi Hannah, Using the same code I sent before, you can append the partner codes to the household code. I apologize, but I don't know how to use the dplyr/tidyr/... stuff so this is written in straight R code using logic statements. ipumsi_8_dta<- read.table( text="country year sample serial h

Re: [R] Error: variable not found

2020-10-30 Thread Michael Dewey
Dear Hannah I think the problem is that attach() is not doing what you think it is. It does seem to make it easy to make mistakes. I would suggest switching to using with() instead or using the data = parameter to functions which support it. Michael On 30/10/2020 08:15, Hannah Van Impe wrot

Re: [R] Error: variable not found

2020-10-30 Thread Jim Lemon
Hi Hannah, Have you tried: summary(ipumsi_8_dta$couple_id) Jim On Fri, Oct 30, 2020 at 7:34 PM Hannah Van Impe wrote: > Hello > > I have a question. I made an r-script and did a few commands needed to > make some new variables. They all work out well, and when I run the > commands, the new

[R] Error: variable not found

2020-10-30 Thread Hannah Van Impe
Hello I have a question. I made an r-script and did a few commands needed to make some new variables. They all work out well, and when I run the commands, the new variables appear in the dataset. I can also work with these new variables to make other new variables from them. Also, when I use su