-2

I've been searching other related questions but nome works for me. I'm totally new on R so please, speak to me like I'm 5. Also, english is not my first language. Now. I made a list on excel. Values between 2000 and 4000 and a header. My Dataset is named "Ejercicio 2.4".

Excel table

Just a simple list. Then, I imported the dataset to R like this:

Import Dataset

I used the summary(Ejercicio_2_4) function to obtain simple stathistical data, but I wanted to usethe mean(Ejercicio_2_4) and I got the following message:

Warning message:
In mean.default(Ejercicio_2_4) :
  argument is not numeric or logical: returning NA

Warning message

What am I doing wrong?

Luisa Reyes
  • 1
  • 1
  • 4
  • 4
    You want the mean of the dataframe column, not the mean of the dataframe itself. See [here](https://stackoverflow.com/questions/23163863/r-need-help-to-calculate-the-mean-of-a-column-in-a-data-frame) for example. Hope this helps! – Florian Mar 03 '18 at 18:10
  • 1
    Sorry. Pictures of data and/or code are generally viewed with extreme annoyance on SO. Learn to post MCVE with text in the body of the question – IRTFM Mar 03 '18 at 18:13
  • 2
    Sorry, first time poting here. I'll try to learn :) – Luisa Reyes Mar 03 '18 at 18:24

1 Answers1

1

As per Florian comment...

 mean(Ejercicio_2_4$Birthweight)

or

colMeans(Ejercicio_2_4)
vsb
  • 428
  • 6
  • 15