To calculate the row-wise mean of a data frame in R, you can use the rowMeans() function. It calculates the mean of each row separately and returns a vector of mean values.
Example code:
# Create a data frame
df <- data.frame(a = c(10, 20, 30), b = c(40, 50, 60), c = c(70, 80, 90))
# Calculate the row-wise mean
row_means <- rowMeans(df)
print(row_means)
Output:
[1] 40 50 60