search for: sampletxt

Displaying 6 results from an estimated 6 matches for "sampletxt".

2017 Jul 11
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...have several paragraphs. One concern I had was that, even if I could get my code working, it would be too inefficient to handle that volume of data. Thanks, Paul library(tidyverse) library(stringr) library(lubridate) sentence_match <- function(x){ sentence_extract <- str_extract_all(sampletxt, boundary("sentence"), simplify = TRUE) sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV")) sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_number], collaps...
2017 Jul 12
2
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Bert, Thanks for your reply. It appears that I didn't replace the variable name "sampletxt" with the argument "x" in my function. I've corrected that and now my code seems to be working fine. Paul ________________________________ From: Bert Gunter <bgunter.4567 at gmail.com> Cc: R-help <r-help at r-project.org> Sent: Tuesday, July 11, 2017 2:00 PM Subjec...
2017 Jul 12
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...t Gunter <bgunter.4567 at gmail.com> Cc: R-help <r-help at r-project.org> Subject: Re: [R] Extracting sentences with combinations of target words/terms from cancer patient text medical records Hi Bert, Thanks for your reply. It appears that I didn't replace the variable name "sampletxt" with the argument "x" in my function. I've corrected that and now my code seems to be working fine. Paul ________________________________ From: Bert Gunter <bgunter.4567 at gmail.com> Cc: R-help <r-help at r-project.org> Sent: Tuesday, July 11, 2017 2:00 PM Subjec...
2017 Jul 13
1
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ify = TRUE) sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV")) sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_number], collapse = "") sentence_match } sampletxt <- structure( list( PTNO = c(1, 2, 2, 2), DATE = structure(c(16436, 16436, 16832, 16845), class = "Date"), TYPE = c("Progress note", "CAT scan", "Progress note", "Progress note"), TVAR = c( "This sentenc...
2017 Jul 11
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...> could get my code working, it would be too inefficient to handle that > volume of data. > > Thanks, > > Paul > > > library(tidyverse) > library(stringr) > library(lubridate) > > sentence_match <- function(x){ > sentence_extract <- str_extract_all(sampletxt, boundary("sentence"), > simplify = TRUE) > sentence_number <- intersect(str_which(sentence_extract, "breast"), > str_which(sentence_extract, "metastatic|stage IV")) > sentence_match <- str_c(sentence_number, ": ", sentence_extract[sente...
2017 Jul 13
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
...ify = TRUE) sentence_number <- intersect(str_which(sentence_extract, "breast"), str_which(sentence_extract, "metastatic|stage IV")) sentence_match <- str_c(sentence_number, ": ", sentence_extract[sentence_number], collapse = "") sentence_match } sampletxt <- structure( list( PTNO = c(1, 2, 2, 2), DATE = structure(c(16436, 16436, 16832, 16845), class = "Date"), TYPE = c("Progress note", "CAT scan", "Progress note", "Progress note"), TVAR = c( "This sentenc...