R beginner here. I have a data.frame that contains information on trotting horses (their wins, earnings, time records and such). I have a subsetted data.frame organised in a way that every row contains information for every specific year the horse competed. I have a variable called Competition.age that states what age the horses were each year they competed.
I'm writing down my summary statistics stratified by age and sex of the horse using both the summary()
function and describe()
from package psych
. For example:
summary(Data_year[Data_year$Competition.age>="3"&
Data_year$Competition.age<="6"& Data_year$Sex=="Mare", ])
This works perfectly fine. But when I try to get a range between 7 and 10 years (instead of 3 and 6), it only returns NA's. The str()
function with this line of code returns a blank list of variables-for some reason it won't read the data.
I've even created separate subsetted data.frames with only these years (7, 8, 9 and 10 respectively) and there are no problems with those, individually. I created subsetted data frames with ranges 7-8, 7-9 and they were fine! But 7-10 created an empty data.frame.
Any help will be greatly appreciated!!