struggling to get a mutate from 5 columns

@dromano I had to log off as I finished my day. NA I did not get any data as its not applicable. I am trying to solve that problem again

Thanks @Nekesa, in that case, it might be less error-prone to keep the data in long form so you don't have to keep looking where to fill in with NA's; that is, assuming you're entering the data manually -- are you?

Hi Dromano,

That is how I have added the columns. I had to use the longest way and it worked. Thank you very much for your help. I still lots of work to do with this project. I will be back if I need more help

Totlumbergrade_outturn %>%
mutate(App_Lumber = select(., Pr_App,Unpr1_App,Unpr2_App,Unpr3_App,Unpr4_App) %>%
rowSums(na.rm = TRUE)) -> 1

Now adding structural lumber

1 %>%
  mutate(Str_Lumber = select(., Pr_Str,Unpr1_Str,Unpr2_Str,Unpr3_Str,Unpr4_Str)  %>%
           rowSums(na.rm = TRUE))  -> 2

### Now adding industrial lumber
2 %>%
  mutate(Ind_Lumber = select(., Pr_Ind,Unpr1_Ind,Unpr2_Ind,Unpr3_Ind,Unpr4_Ind)  %>%
           rowSums(na.rm = TRUE))  -> 3

####Now adding Outdoor lumber
3 %>%
  mutate(Out_Lumber = select(., Pr_Out,Unpr1_Out,Unpr2_Out,Unpr3_Out,Unpr4_Out)  %>%
           rowSums(na.rm = TRUE))  -> final

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.