variable-names
Am I immoral for using a variable name that differs from its type only by case?
What is the reasoning of those telling you this is bad? I do this all the time. It is the simplest, expressive way to name a single variable of a type. If you needed two Person objects then you could prefix person with meaningful adjectives like fastPerson slowPerson otherwise just person is fine with me.
How can I load an object into a variable name that I specify from an R data file?
If you’re just saving a single object, don’t use an .Rdata file, use an .RDS file: x <- 5 saveRDS(x, “x.rds”) y <- readRDS(“x.rds”) all.equal(x, y)
Why can’t variable names start with numbers?
Because then a string of digits would be a valid identifier as well as a valid number. int 17 = 497; int 42 = 6 * 9; String 1111 = “Totally text”;
A table name as a variable
For static queries, like the one in your question, table names and column names need to be static. For dynamic queries, you should generate the full SQL dynamically, and use sp_executesql to execute it. Here is an example of a script used to compare data between the same tables of different databases: Static query: SELECT …