If you are bootstrapping the mean you can do as follows:
set.seed(1)
library(boot)
x<-rnorm(100)
meanFunc <- function(x,i){mean(x[i])}
bootMean <- boot(x,meanFunc,100)
>bootMean
ORDINARY NONPARAMETRIC BOOTSTRAP
Call:
boot(data = x, statistic = meanFunc, R = 100)
Bootstrap Statistics :
original bias std. error
t1* 0.1088874 0.002614105 0.07902184
If you just input the mean
as an argument you will get the error like the one you got:
bootMean <- boot(x,mean,100)
Error in mean.default(data, original, ...) :
'trim' must be numeric of length one