anesrake error : Error in targetvec - dat : non-numeric argument to binary operator


I have a dataframe which I am trying to reweigh using anesrake. My targets are saved in a list called targets but when I try to use the package, I get the error - Error in targetvec - dat : non-numeric argument to binary operator.

However, I tried to use reprex and the reprex output does not mention this error. Does anyone have advise on how I can resolve this?

There was a similar post here but with no answer and the post is now locked.


``` r
#> Loading required package: Hmisc
#> Loading required package: lattice
#> Loading required package: survival
#> Loading required package: Formula
#> Loading required package: ggplot2
#> Attaching package: 'Hmisc'
#> The following objects are masked from 'package:base':
#>     format.pval, units
#> Loading required package: weights
myweights <- anesrake(targets, data, 
                      caseid = data$machine_id, cap = 9, type = "nolim")
#> Error in dataframe[filter == 1, ]: object of type 'closure' is not subsettable

Created on 2022-09-02 with reprex v2.0.2

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.