I have defined the following function in R.
#!/usr/bin/Rscript
fahr_to_kelvin <- function(temp) {
kelvin <- ((temp - 32) * (5 / 9)) + 273.15
print("Hello World")
return(kelvin)
}
When I enter fahr_to_kelvin(32) in the R console, it returns 273.15 (without printing "Hello World"! I do not know why!) Anyway, I try to code below:
chmod +x ~/tuning1/Fun1.R
~/tuning1/Fun1.R
However, nothing appears in the terminal (with no error). Would you please help me why it is not working?