Re: [R] Help with loop for column means into new column by a subset Factor w/131 levels

2019-04-30 Thread Bill Poling
I ran this routine but I was thinking there must be a more elegant way of doing this. #https://community.rstudio.com/t/how-to-average-mean-variables-in-r-based-on-the-level-of-another-variable-and-save-this-as-a-new-variable/8764/8 hcd2tmp2_summmary <- hcd2tmp2 %>% select(.) %>%

[R] Help with loop for column means into new column by a subset Factor w/131 levels

2019-04-30 Thread Bill Poling
Good afternoon. #RStudio Version 1.1.456 sessionInfo() #R version 3.5.3 (2019-03-11) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows >= 8 x64 (build 9200) #I have a DF of 8 columns and 14025 rows str(hcd2tmp2) # 'data.frame':14025 obs. of 8 variables: # $