I have some problem with passing NA in an array to R for imputeTS package.
assume I have this array:
a = Any[1, 2, 3, NaN, 5]
and I want to pass it to this:
R"""
b <- na_seadec($a, algorithm = "kalman", find_frequency = TRUE, maxgap = Inf)
"""
NaN does not convert to NA automatically. How can I pass exactly NA value to RCall?
NaN
in Julia will beNaN
in R. If you wantNA
in R you should usemissing
in Julia:You can find the details in this section of the Julia manual.
And here is an example session: