View source: R/createProfile.R
1 | createProfile(response)
|
response |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (response)
{
cat("Which candidate's data do you want to load:", "\n")
response <- readline(prompt = "Candidates Name:")
profile <- list(profname = response, filename = NULL, text = NULL,
emot = NULL)
for (name in response) {
pattern <- as.character(name)
profile$filename <- list.files(pattern = pattern)
for (i in 1:length(profile$filename)) {
temp <- read.csv(profile$filename[i], header = TRUE)
profile$text[i] <- paste0(temp$Text, collapse = ".")
centex <- centerText_2(paste0("I'm reading ", profile$profname,
"'s speech >>>>>>>>>>>> ", round(i/length(profile$filename) *
100, 2), "%", " >>>>>>>>>>>>>>>>>"))
cat("\r", centex$ws, centex$mid, sep = "")
Sys.sleep(0.2)
}
}
cat("\n")
invisible(return(profile))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.