I’m trying to make a simple subset of a df based on a POSIXct variable, but it doesn’t work…
a2001 <- subset(anillas, anillas$data=="21-03-2001")
it gives “0 obs. of 74 variables”
are those variables different in any way I don’t know?
Tks.
Ok, so this is part of the str(anillas)
$ rc : num NA NA NA NA NA NA NA NA NA NA ...
$ ss : num NA NA NA NA NA NA NA NA NA NA ...
$ tg : num NA NA NA NA NA NA NA NA NA NA ...
$ ug : num NA NA NA NA NA NA NA NA NA NA ...
$ data : POSIXct, format: "2001-03-21" "2001-03-23" ...
You have to compare with what’s comparable. In your attempt you compared a
POSIXctobject with acharacterstring.You need first to convert the date you want to subset
anillaswith toPOSIXct: