Jim Kent training error

Thank you for reading my problem.

I am running a training exercise and an error says it cannot find my data. Can you help me find it?

Here is the specific error message

Error: object 'Surv_clean' not found

A clean version of the offending code that created the error is pasted below.

# make the minimal dataset
#surv_raw %>% 
#  head(5) %>%                      # take the top 5 rows only
#  select(adm3_name_res, sex) %>%   # keep only the relevant columns
#  dpasta()                         # convert to stand-alone R code

Created on 2026-03-18 with reprex v2.1.1

Session info

sessionInfo()
#> R version 4.5.2 (2025-10-31 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 22631)
#> 
#> Matrix products: default
#>   LAPACK version 3.12.1
#> 
#> locale:
#> [1] LC_COLLATE=English_United States.utf8 
#> [2] LC_CTYPE=English_United States.utf8   
#> [3] LC_MONETARY=English_United States.utf8
#> [4] LC_NUMERIC=C                          
#> [5] LC_TIME=English_United States.utf8    
#> 
#> time zone: America/New_York
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] digest_0.6.39     fastmap_1.2.0     xfun_0.56         glue_1.8.0       
#>  [5] knitr_1.51        htmltools_0.5.9   rmarkdown_2.30    lifecycle_1.0.5  
#>  [9] cli_3.6.5         reprex_2.1.1      withr_3.0.2       compiler_4.5.2   
#> [13] rstudioapi_0.18.0 tools_4.5.2       evaluate_1.0.5    yaml_2.3.12      
#> [17] otel_0.2.0        rlang_1.1.7       fs_1.6.6

Hey Jim!

The error means R cannot find an object named Surv_clean in your current session.

In the code you shared, Surv_clean is never created.

This is likely an object name mismatch, if you created surv_clean but later wrote Surv_clean, you’ll get:

Error: object 'Surv_clean' not found

Remember that R is case sensitive! please check the variable name and let me know if that was it!

Best,

Luis