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) Jun 23, 2015 at 23:29
  • superuser.com/questions/667622/… 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.
    – SabDeM
    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?
    – Quantopik
    Jun 23, 2015 at 23:33
  • 1
    @Quantopic - AltGr + ^ supposedly works on Linux according to my linked question. Jun 23, 2015 at 23:38

3 Answers 3

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

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.

0
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
  • 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.
    – Quantopik
    Jun 23, 2015 at 23:44
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.