source('CodeToRun.R')
Script R4SNOMEDCT https://github.com/lhncbc/r-snippets-bmi/tree/master/R4SNOMEDCT allows exploring SNOMED CT. This is a vignette for this script.
release='20200131'
print(release)
## [1] "20200131"
nc<-sct_get_new_concepts(release)
#how many new concepts
nrow(nc)
## [1] 4707
#names(nc)
nc %>% count(tag,sort = TRUE) %>% datatable(rownames = FALSE)
#large enough tags
tags<-nc %>% count(tag) %>% filter(n>=10)
#3 sample concepts (without ID!) per tag)
aa<-nc %>% inner_join(tags) %>% group_by(tag) %>% sample_n(3)
## Joining, by = "tag"
aa %>% select(tag,term) %>% datatable(rownames = FALSE)
#mtcars %>% group_by(cyl) %>% sample_n(2)
#ab %>% nc %>% filter(tag=='Substance')