svyr- fpc (error message)

Having trouble with the fpc in srvyr -

baro_weightedpointcoverage_srvyr <- df_child_level_baro_point_coverage %>%
as_survey_design(ids=grappe_no,fpc=~fpc, weights=~HH_weight)

Error: Formula shorthand must be wrapped in where().

You don't need the tildes (~). See example below with data from the survey package:

library(survey)
#> Loading required package: grid
#> Loading required package: Matrix
#> Loading required package: survival
#> 
#> Attaching package: 'survey'
#> The following object is masked from 'package:graphics':
#> 
#>     dotchart
library(srvyr)
#> 
#> Attaching package: 'srvyr'
#> The following object is masked from 'package:stats':
#> 
#>     filter

data(api)

dclus1 <- apiclus1 %>%
  as_survey_design(ids=dnum, weights = pw, fpc = fpc)

dclus1_yourexample <- apiclus1 %>%
  as_survey_design(ids=dnum, weights = ~pw, fpc = ~fpc)
#> Error: Formula shorthand must be wrapped in `where()`.
#> 
#>   # Bad
#>   data %>% select(~fpc)
#> 
#>   # Good
#>   data %>% select(where(~fpc))

Created on 2021-11-23 by the reprex package (v2.0.1)