• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How to create a row in a table for (Range) to include (Min:Max) together in R?

Resolved: How to create a row in a table for (Range) to include (Min:Max) together in R?

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

Question:

I want to create a table which includes(Mean, SD and Range) for stop types. I used the following but I got two problems clear in the result table:
  1. The labels of the first row (Mean) and the second row (SD) are missing. How can I include them with keeping the values rounded?

  2. I want to create a row for (Range) to include (Min:Max) together, separated by a colon. It gives wrong results. how can I correct that?


Answer:

  1. You can use named arguments for rows in rbind to name the rows.
  2. If you want the Range to be two numbers separated by a colon, then you can use paste, but the entire table will become a character matrix. This may not be what you want. However, you can still print it nicely using noquote

Created on 2022-06-16 by the reprex package (v2.0.1)
Data used (taken from question)

Mean <- c(b = -117, d = -130, g = -117, k = 84, p = 55, t = 66) SD <- c(b = 37, d = 33, g = 28, k = 18, p = 12, t = 18) Min <- c(b = -220, d = -219, g = -200, k = 50, p = 39, t = 40) Max <- c(b = -60, d = -70, g = -42, k = 118, p = 84, t = 111) [/code]

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

r
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Openlayers: Update clusters depending on filter (geometryFunction)

24/03/2023

Resolved: Getting ‘502 Bad Gateway’ while deploying Springboot app in EKS

24/03/2023

Resolved: Why is NGINX’s $request_uri empty?

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

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