Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

How to calculate enthalpy by using mutate for each column in R?

$
0
0

I would like to calculate enthalpy by using steam table function . I want to adapt the function to a Tibble table which include temp and pressure, but failed. For example, I want to add the enthalpy row.

sample_table    

temp pressure
800  16
900  17
1000 18

sample_table_add_enthalpy <- sample_table %>%
  mutate(enthalpy = hTp(temp, pressure))

The result is

temp pressure enthalpy
800  16     3375.08509
900  17     3375.08509
1000 18     3375.08509

In this case, the calculation is only adapted to the first column. How should I do to calculate for all column by using mutate?


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>