On Tue, 14 Sep 2021, Bert Gunter wrote:

Remove all your as.integer() and as.double() coercions. They are
unnecessary (unless you are preparing input for C code; also, all R
non-integers are double precision) and may be the source of your problems.

Bert,

When I remove coercions the script produces warnings like this:
1: In mean.default(fps, na.rm = TRUE) :
  argument is not numeric or logical: returning NA

and str(vel) displays this:
'data.frame':   565675 obs. of  6 variables:
 $ year : chr  "2016" "2016" "2016" "2016" ...
 $ month: int  3 3 3 3 3 3 3 3 3 3 ...
 $ day  : int  3 3 3 3 3 3 3 3 3 3 ...
 $ hour : chr  "12" "12" "12" "12" ...
 $ min  : int  0 10 20 30 40 50 0 10 20 30 ...
 $ fps  : chr  "1.74" "1.75" "1.76" "1.81" ...

so month, day, and min are recognized as integers but year, hour, and fps
are seen as characters. I don't understand why.

Regards,

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to