• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home » Resolved: Summary statistics needed when NAs are present in a data frame’s common rows

Resolved: Summary statistics needed when NAs are present in a data frame’s common rows

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

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:
These commands lead me to the following output:

If you have better answer, please add a comment about this, thank you!

r
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Resolved: How do I stop the command from happening if the requirements for it to work aren’t sert Discord.js

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.