I need to write often down the tilde symbol in R, but I did not find anything useful browsing on the internet. I am using an Italian keyboard on a Linux OS.
Does some of you have any ideas?
Any hint or advises would be appreciated.
According to this link over at Superuser:
https://superuser.com/questions/667622/italian-keyboard-entering-the-tilde-and-backtick-characters-without-cha
AltGr + ^
will give you a tilde ~~~~ on a Linux system with an Italian keyboard, which is what you said you were using in the comments.
(tilde <- rawToChar(as.raw(126)))
# [1] "~"
You could use this variable when you need tilde in text.
summary(lm(paste0("Sepal.Length", tilde, "Sepal.Width"), data=iris))
# Call:
# lm(formula = paste0("Sepal.Length", tilde, "Sepal.Width"), data = iris)
#
# Residuals:
# Min 1Q Median 3Q Max
# -1.5561 -0.6333 -0.1120 0.5579 2.2226
#
# Coefficients:
# Estimate Std. Error t value Pr(>|t|)
# (Intercept) 6.5262 0.4789 13.63 <2e-16 ***
# Sepal.Width -0.2234 0.1551 -1.44 0.152
# ---
# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
# Residual standard error: 0.8251 on 148 degrees of freedom
# Multiple R-squared: 0.01382, Adjusted R-squared: 0.007159
# F-statistic: 2.074 on 1 and 148 DF, p-value: 0.1519
Alternately, you could just type tilde
and copy and paste the character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With