I have a SQL query that when executed directly in R returns the correct result. A dataframe without German quotation marks. But when I run it in RMarkdown (to create a dashboard with Flex Dashboard) the quotes are in the requested dataframe. I think the problem is in the language settings, but I just can't get any further. The line
REPLACE(REPLACE(news.headline,'„',''),'“','') as headline
ensures that the German quotation marks do not appear in the query.
---
title: "News Performance"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
---
{r setup, include=FALSE}
library(flexdashboard)
library(RMySQL)
con = dbConnect(drv = MySQL(),
user = DB_user,
password =DB_pass,
host = "DB_Host",
port = Port_number,
dbname = "DB_Name")
SQL_Statement = paste0("SELECT news.news_Id,
REPLACE(REPLACE(news.headline,'„',''),'“','') as headline
FROM news
GROUP BY news.headline
")
# get query
news_aktuell = dbGetQuery(con, SQL_Statement)