-2

I want make a summary table by group in R
compare several parameter by factor
For example

data(iris)
str(iris)

i wanna make table

     Group   Sepal.Length Sepal.Width Petal.Length Petal.Width
  Species1        mean       mean        mean       mean
  Species2        mean       mean        mean       mean
  Species3        mean       mean        mean       mean 

possible import t.test result
How do i do?

nghauran
  • 6,648
  • 2
  • 20
  • 29

1 Answers1

-1
data(iris) 
aggregate(iris[,1:4], list(iris$Species), mean)
Aleksandr
  • 1,814
  • 11
  • 19
  • actually my data set is [ Classes ‘data.table’ and 'data.frame': 446 obs. of 23 variables] numeric data is 6:23. type upper code, i saw error message like this 'list(df3$region)' is not a function, character or symbol.. what wrong? – Sung min Yang Nov 21 '17 at 08:25
  • Show your data snipet by dput(datafile) – Aleksandr Nov 21 '17 at 08:26
  • Check if the non-numeric variable called `region` is not between the 6th and the 23rd column – nghauran Nov 21 '17 at 08:32