Generate frequency plot of a column containing multiple character strings

24 Views Asked by At

I want to generate a frequency plot of multiple character strings separated by semicolon that Excel has generated a single column of 315 responses. Link to table

I have 19 different character string variables. Each column includes 0 - 5 variables separated by semicolon making it hard to generate frequency histogram.

EpiDisplay can generate frequency histograms of simple responses (e.g. gender, infections) but it does not recognize multiple strings of a character separated by semicolon. tab1(dedup$Barrier Summary, cum.percent = TRUE) Error in plot.new() : figure margins too large

Tried to replace string with with singular words using Sapply (e.g. "know" for "did not know") but the format errors

y <- c("know", "reason", "GP", "all", "Forgot", "wait", "recent", "Doctor", "time", "Unsure", "Doctor", "Price", "Unsure", "Ambivalent", "Recent", "ADR", "time", "Personal", "Refuse") x <- sapply(y, grepl, Barriers, ignore.case = TRUE)

Barriers$keywords <- apply(x, 1, function(i) paste(x[which(i)], collapse=", ")) Error in $<-.data.frame(*tmp*, keywords, value = c("", "FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE" : replacement has 2 rows, data has 315

Is there a package that can generate a histogram recognizing multiple strings of characters (in any order) in a single column? Microsoft office forms did a terrific job except "Other" has no value in interpretation. Microsoft histogram

0

There are 0 best solutions below