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

set a loop to use a function in r

$
0
0

I have a dataframe with three columns and I would like to calculate 95% Upper tolerance levels for each variable in media. Here is how the data looks like: So, for plastic and water I need to calculate tolerance levels separately for each variable and write it as 4th column. I am using

nptol.int(data$result, alpha = 0.05, P = 0.95, side = 1, method=c("WILKS")) 

function.

media   variable    result
plastic A   2.3
plastic B   4
plastic C   4.6
plastic D   3
plastic A   2
plastic B   5
plastic C   6.7
plastic A   8
plastic B   5
plastic C   4
water   A   2
water   B   4
water   C   5
water   A   8.2
water   B   4
water   C   5
plastic A   6
plastic B   7
plastic C   11.2

Thanks,


Viewing all articles
Browse latest Browse all 201894

Trending Articles



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