atorus-research / metacore

https://atorus-research.github.io/metacore/
Other
33 stars 7 forks source link

Metacore codelist is read only #98

Closed daniel-woodie closed 9 months ago

daniel-woodie commented 1 year ago

I'm going through the process of creating a custom metacore object based on a template. Specifically, I'm trying to update the age ranges from the pilot metacore object. I'm guessing this is set in defining the class but the codelist table is read only.

load(metacore_example("pilot_ADaM.rda"))
metacore <- metacore %>% select_dataset("ADSL")

# Define new derivations...
metacore$codelist[which(metacore$codelist$code_id == "CL.AGEGR1"),]$codes <- list(tibble(code = c("<55", "55-80", ">80"), decode = c("<55", "55-80", ">80")))

I guess the broader question I have is how do you create your own custom metacore objects directly within R? Also, how can you edit an existing template?

statasaurus commented 9 months ago

You can create a custom metacore object, but you have to make it from scratch rather than editing an already made metacore object