I'm not sure what is incorrect but R only returns one value when running this code
combinesub4<-group_by_at(combinesub3,vars(USUBJID,PARAMCD))
combinesub5<-summarize(combinesub4,AVAL=mean(AVAL,na.rm=TRUE))
I also used the "plain" group_by as well with the same result (one value returned, no grouped summary results)
Please provide a small reproducible example, just so we can understand with what data you work and what you try to do (maybe one value is actually correct because of your data).
What libraries are currently loaded in your session? Maybe there is another function masking dplyr::group_by() or dplyr::summarise()? Try to add dplyr:: in front of group_by() and summarise() to see if there is only one value returned again.
Does this code show that you typed AVAL as a line of code and submitted it to look at the value, or is the idea that AVAL 1 2.857143 appeared as a direct and immediate result of the data and pipe group_by summarise functions ?
Ok that seems to have worked. It must be a masking thing.
The libraries I have loaded are:
base
dplyr
datasets
forcats
foreign
ggplot2
gsubfn
haven
methods
plyr
purrr
readr
rsqlite
sqldf
stats
stringr
tidyr
tibble
tidyverse
utils
Happy that I could help.
Please accept the answer solving the issue to indicate, that a soultion was found.
You can see which package causes the issue, if you write ?group_by (or ?summarise) in your console and have a look which functions pop up in the documentations. Additionally, you may consider rethinking your packages you load. E.g. dplyr is inside tidyverse, as well as tidyr is. So it's pointless to load tidyverse with dplyr and tidyr.