After more than three hours’ efforts I have to give up the complicated configuration of Emacs and ESS. I just downloaded R 2.4.0 again in order to use the function source() which is convenient for “tidying up” my codes. For example, below are my source codes (which look ugly):
y=.1+runif(20,.2,1)
xx=c(1,1:20,20)
yy=c(0,y,0)
plot(xx, yy,type='n',xlab='x',ylab='y')
for (i in 255:0){
yy=c(0,y-(1-i/255)*min(y),0)
polygon(xx,yy,col=rgb(1,i/255,0),border=NA)
Sys.sleep(.05)
}
When I use source() in R 2.4.1, they look like:
> source("D:\\Yihui\\R\\gradient.r", echo = T, max = 1000)
> y = 0.1 + runif(20, 0.2, 1)
> xx = c(1, 1:20, 20)
> yy = c(0, y, 0)
> plot(xx, yy, type = "n", xlab = "x", ylab = "y")
> for (i in 255:0) {
yy = c(0, y - (1 - i/255) * min(y), 0)
polygon(xx, yy, col = rgb(1, i/255, 0), border = NA)
Sys.sleep(0.05)
}
We can also prevent > by setting the parameter prompt = "". From R 2.5.0, the function has stopped tidying up my codes. That’s a pity.
赞赏
作为一名没有固定工作的自由职业者,我非常感谢您通过捐赠的方式来支持我的写作和开源软件开发。当然,捐赠纯属自愿。无论金额多少,都是一片诚挚的心意。支付方式如下:
| 微信 | ← 奋力支开它俩 → | 支付宝 |
|---|---|---|
![]() |
其它爱心通道 ↓ Venmo: @yihui_xie Zelle: xie@yihui.name PayPal: xie@yihui.name |
![]() |
若使用 Venmo/Zelle/Paypal,请添加备注“gift”或“donation”,以免捐赠被视为我的可税收入。若使用 Paypal,支付类型请选 Family and Friends,而不要选 Goods and Services。
在不影响生活的前提下,我会将收到的捐赠以尽量大的比例回馈给开源社区和慈善机构。作为参考,2024-25 年间我共收到约三万美元捐赠,完税后我转手捐出了一万五千美元。

