Skip to content

Instantly share code, notes, and snippets.

@HamiltonWang
Created May 17, 2017 05:29
Show Gist options
  • Save HamiltonWang/0d604737f2930f8bc76560ff7a31ad54 to your computer and use it in GitHub Desktop.
Save HamiltonWang/0d604737f2930f8bc76560ff7a31ad54 to your computer and use it in GitHub Desktop.
R Language Introduction
sink('my_data.txt', split=TRUE)
print(exp(10))
cat('假設我每天去旅遊,那我破產的機率是多少?=', exp(4), '\n')
sink()
> 9 * (2.3 + 1.125) * 2.5/5.1 + 0.23E3
[1] 245.1103
sqrt(610.25)
[1] 24.70324
> exp(10)
[1] 22026.47
> log10(10000)
[1] 4
> round(1.1234, 2)
[1] 1.12
> x <- 1:6
> x
[1] 1 2 3 4 5 6
> y <- c(1 ,3, 5, 7, 9, 12)
> y
[1] 1 3 5 7 9 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment