Mean: To calculate the mean (average) of a numeric variable, you can use the mean() function. For example, if you have a vector of data called data_vector, you would compute the mean like this:
mean_result <- mean(data_vector)
Median: To find the median (middle value) of a dataset, you can use the median() function. Similar to the mean, if you have your data in data_vector:
median_result <- median(data_vector)
Mode: Unlike mean and median, R does not have a built-in function to calculate the mode directly. You may need to create a custom function to find the mode if required.