According to R specification when we perform subscription on data frames defined by data.frame( ... )
e.g. df[1, 2]
the printed value should be a FACTOR, however, in my case, it's printing normal vector. What could have gone wrong?
my.dataset <- data.frame(site = c('A', 'B', 'A', 'A', 'B', 'B'),
season = c('Winter', 'Summer', 'Summer',
'Spring', 'Fall', 'Spring'),
pH = c(7.4, 6.3, 8.6, 7.2, 8.9, 8.4))
When I print:
my.dataset[1,2]
[1] "Winter"
Why printed out a vector not a factor?