Certainly! Here is an example of R code that calculates the mean and standard deviation of a vector of numbers:
Brooks Computing Systems - Jacksonville
Visit Brooks Computing Systems
Mainframes, Desktops & Web Sites
Certainly! Here is an example of R code that calculates the mean and standard deviation of a vector of numbers:
# Create a vector of numbers
numbers <- c(1, 2, 3, 4, 5)
# Calculate the mean of the vector
mean_value <- mean(numbers)
print(paste("Mean:", mean_value))
# Calculate the standard deviation of the vector
sd_value <- sd(numbers)
print(paste("Standard Deviation:", sd_value))When you run this code in an R environment, it will output:
[1] "Mean: 3"
[1] "Standard Deviation: 1.581139"Quality, Reliability & Service Consultancy for Mainframes, Desktops & Web Sites