Re: [R] creating a new variable and merging it on the dataframe

2021-10-18 Thread Grzegorz SmoliƄski
Hi, If you had really just used: wbpractice %>% mutate(gap = total.food.exp-total.nfood.exp) #gen a variable and then checked by: names(wbpractice) then the problem is just with missed assignment, i.e. it should be: wbpractice <- wbpractice %>% mutate(gap = total.food.exp-total.nfood.exp) #

Re: [R] creating a new variable and merging it on the dataframe

2021-10-18 Thread PIKAL Petr
Hi I cannot say anything about mutate but read.csv results in data frame you can use then wbpractice$gap <- with(wbpractice, total.food.exp-total.nfood.exp) Cheers Petr BTW, do not use HTML formating your email is a mess. > -Original Message- > From: R-help On Behalf Of Admire Tari