4

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.

7
  • 3
    fortunes::fortune(35) Commented Jun 23, 2015 at 23:29
  • superuser.com/questions/667622/… Commented Jun 23, 2015 at 23:32
  • ALT + 5 in Italian Keyboards for MAC OS, but I am not sure (Italian too but I have un UK keyboard), and ALT + 126 for Windows user. Commented Jun 23, 2015 at 23:33
  • @Pascal, it's an Italian keyboard. There isn't on the keyboard, so I really don't know how can I do that. Some advice? Commented Jun 23, 2015 at 23:33
  • 1
    @Quantopic - AltGr + ^ supposedly works on Linux according to my linked question. Commented Jun 23, 2015 at 23:38

3 Answers 3

7

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.

Sign up to request clarification or add additional context in comments.

Comments

6
(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.

1 Comment

Thank you for the answer, it is really genial, but I would like some more intituitive. Anyway, firstly +1 and, secondly, @latemail suggested a solution by using the keyboard directly.
1

If you are using Italian keyboard layout & also Linux OS then try F5.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.