The reason that you get two similar types(eg. Social media) is that "seemingly" same levels in different columns, are actually different
For example: "social media" vs. "social media ".
You shoud omit all the empty spaces after each levels.
As code I wrote bellow:
library(stringr) # library for strings manipulation
#trim all the white spaces before and after levels
research_struct_corrected <- apply(research_struct, 2, str_trim)
It removes all the white spaces before and after each levels and creates something like this(I show it in dput format to see the difference, but in real, it prints out it as routine dataframe:
structure(
list(
WayOfResearch1 = c(
"Search engines",
"Search engines",
"Search engines",
"Search engines",
"Search engines",
"Recommendations from friends and family",
"Search engines",
"Search engines",
"Search engines",
"Search engines"
),
WayOfResearch2 = c(
"Online reviews",
"Recommendations from friends and family",
"Recommendations from friends and family",
"Recommendations from friends and family",
"Recommendations from friends and family",
"Social media",
"Recommendations from friends and family",
"Online reviews",
"Social media",
"Online reviews"
),
WayOfResearch3 = c(
"Social media",
"Print magazines/newspapers",
"Social media",
"Online reviews",
"Online reviews",
"Professional photographers' recommendations",
"Social media",
"Professional photographers' recommendations",
"Email subscriptions",
"Social media"
)
),
row.names = c(NA,
10L),
class = "data.frame"
)
and then:
library(knitr) #library for nice table
df_organized <- as.data.frame(table(unlist(research_struct_corrected)))
colnames(df_organized) <- c("Type", "Value")
kable(df_organized)
It create something like this:

Now, does it work?