I'm trying to use the typed content of a vector as title for a graph. Therefore (i think) i first need to convert the typed content to characters. And here it gets tricky....
I already tried to convert the content to "as.character()", "format()" etc...but in all cases i get the output of the dataframe itself en not just the content of the typen vector.
For example, say have I have 2 vectors...test_a and test_b
test_a <- read.csv2("test.csv", sep = ";", dec = ",")
test_b <- read_excel("test.xlsx")
x <- test_a ##(or test_b)
y <- as.character(x) ##this doesn't work :(
fig <- ggplot(x, aes(x = OUTCOME))
fig + geom_histogram(aes(color = SEX),
breaks=seq(0, 1500, by = 1),
alpha = 1) +
ggtitle(as.character(y))
As title of the graph I expect to get "test_a" or "test_b" as in "y" and not the numbers in test_a or test_b...Your help is appreciated a lot..