i want to know how to write R script that takes from the user a list of numbers and outputs the following of the list:
- Mean and median.
- Standard deviation and range.
i want it to receive any input data from the keyboard and display data on the screen.
here the script that i used :
num <- readline (prompt = "list of numbers") num <- as.numeric(num) result.mean <- mean(num) print (result.mean) result.median <- median(num) print(result.median) result.sd <- sd(num) print(result.sd)
but it didnt work and i'm sorry if the script not in correct format but i dont know how to display it .