Question:I have a data frame that may or may not contain NAs. If NAs are present, they are present in identical rows. My included code for columns when NAs are not present works as desired for calculation of summary statistics. Presence of NAs produce NAs for the summary stats.
I have have a feeling this solution will somehow figure into my solution , though my attempts so far are not successful. One of my columns is of character format (‘a’ in this example) and requires bypassing with is.numeric.
R: summarise a dataframe with NAN in columns summarise(across(.fns = na.omit))
Answer:By using the symbol
~, in .fns argument, you can customize your desired function:
If you have better answer, please add a comment about this, thank you!