# R version of the get_from_table program # copyright 2019, January Roger M. Palay # Saline, MI 48176 get_from_table <- function( first_low, first_high, freqs) { step_size <- first_high -first_low num_steps <- length( freqs) low_vals <- first_low+(0:(num_steps-1))*step_size mid_points <- low_vals+ step_size/2 from_table_x <<- rep( mid_points, freqs ) table_size <- length( from_table_x ) table_mean <- mean( from_table_x ) table_sd <- sd( from_table_x ) table_pop_sd <- table_sd* sqrt( (table_size-1)/table_size ) out_vals <- c( table_size, table_mean, table_sd, table_pop_sd ) names( out_vals ) <- c("size","mean", "sd", "pop sd" ) return (out_vals) }