@jcblum
I need more help in this topic.
Now, I am using R Notebook because R script does not seem to work for me.
So, let's take a look at this example
SELECT "month_idx", "year", "month", SUM(CASE WHEN ("term_deposit" = 'yes') THEN (1.0) ELSE (0.0) END) AS "subscribe",
COUNT(*) AS "total"
FROM ("bank")
GROUP BY "month_idx", "year", "month"
I noticed that the example put "..." around the variables such as "month_idx". I used SQL Studio Management and the SQL command we use in there does not need to put quotation mark around the variables.
I am wondering in R Notebook or R script , do I have to put quotation mark around the variables?
Because there are A LOT OF corrections for me to do that, I want to make sure whether there is a way around it.
Right now, I have:
con <- dbConnect(odbc::odbc(), "a server name will go into here")
You know like when you import a data set and store it into a variable name called "df" or something. Then you attach(df), which gives you access to variables in df without referring to "df" when you need to do some operations on the variables and you don't need a quotation mark around these variables when calling these variables. For instance, df is a dataframe with "grades" and "GPA" fields. After calling "attach(df)", you can just do some operations such as sum(GPA) instead of sum(df$GPA). I think you all know what I mean. If not, let me know.
I am thinking whether there is a way for me in SQL command in R notebook to call up these variables without putting ".." around the variables.
What do you think? Impossible?