Comments (19)
安装pandoc,然后再运行./knit html
就会生成一个完整的带目录的HTML文件。不过目前你的R代码有些地方好像还有问题,至少上次我运行knitr编译通不过。还有一个地方可能用了edit()或fix(),这样的函数最好不要用,原因有二:
- 它们鼓励用户在R里面通过界面的方式修改数据,这是很糟糕的数据处理方式,不可重复;所有数据修改一定要用代码改;
- 代码运行到这里会停下来等待用户操作,比如跑knitr的时候。
from play-econometrics-with-r.
嗯 是有edit()出现,只是为了举例……其实前面就给出替代方案了……
已经修正了,你试试能跑出结果来了么?
from play-econometrics-with-r.
其实你不必删除,用选项eval=FALSE
就可以了
from play-econometrics-with-r.
编译出来的文件已经上传到:https://github.com/cloudly/Play-Econometrics-with-R/downloads
放在库目录下就可以看了。我看了一下HTML输出,有一肚子建议,等我抽空一一提出。
from play-econometrics-with-r.
嗯嗯 有没编译出来的地方,还有各种typo...不过看到一个成型的东西,感觉还是蛮开心的,哈哈~~~~
2012/4/10 Yihui Xie <
[email protected]
编译出来的文件已经上传到:https://github.com/cloudly/Play-Econometrics-with-R/downloads
放在库目录下就可以看了。我看了一下HTML输出,有一肚子建议,等我抽空一一提出。
Reply to this email directly or view it on GitHub:
Find me at www.cloudlychen.net
M.Sc Economics
Barcelona Graduate School of Economics
Ramon Trias Fargas, 25-27
08005 Barcelona
Google Talk: [email protected]
from play-econometrics-with-r.
是啊,写这种和程序有关的文档最爽的就是编完一看,图啊表啊代码啊神马的全都冒出来了,相当有成就感(其实有时候也就是在撑页数,哈哈)
from play-econometrics-with-r.
我还是没搞定…… knit 是用R调用么?
我在win 7下,输入 Rscript knit html
报错为:
Error: could not find function "pat_gfm"
from play-econometrics-with-r.
markdown的支持是我在最新的开发版本中支持的,所以你需要安装开发版本:
https://github.com/yihui/knitr#readme
不过建议你明天再装,因为这里面还有些不成熟的东西我正在微调,快调完了。
from play-econometrics-with-r.
代码中错误太多啊,我都不忍心跑下去了:)
from play-econometrics-with-r.
还有很多错误?呃....
from play-econometrics-with-r.
你跑一遍就知道了
from play-econometrics-with-r.
抱歉刚刚从杭州回来……哈哈这周末useR们在上海玩的很开心 :D 我已经开始当knitr的小白鼠了,fighting~
from play-econometrics-with-r.
木事儿,玩得开心就好
from play-econometrics-with-r.
plot()搞不定……5555
from play-econometrics-with-r.
有啥搞不定的啊?图形都会自动处理,比如
``` {r plot-demo}
plot(1)
```
from play-econometrics-with-r.
.有几个比较诡异的问题:
比如这行,
names(sample)[2] <- "RECORD_DAY"
## Error: names() applied to a non-vector
还有这种报错:
## Error: object of type 'closure' is not subsettable
都是为啥啊...直接在R里运行这些代码是没有问题的啊。
from play-econometrics-with-r.
还有这种错误。。。。
## Error: cannot open file 'cache-upload/sur_1fc09f25342da747c062498313dc32c6.rdb': No such file or directory
from play-econometrics-with-r.
names(sample)[2]
错误我回头检查一下,不过sample
显然是一个糟糕的名字(况且它还是R自带的函数);关于变量名命名,记住这句话:
你不会给你的猫起名叫“猫”,给狗起名为“狗”,所以不要给样本起名叫“sample”,不要给数据起名叫“data”
命名是编程中最难的部分之一。
from play-econometrics-with-r.
我查了几个小时,终于找出图片出错的原因了。说起来话太长,解决方案和简单的解释参见 7aea43c 。
其它的错误要是还存在请新开issue讨论。
from play-econometrics-with-r.
Related Issues (6)
- 两年了啊 HOT 33
- R代码段的语法 HOT 4
- 图片不要传上来 HOT 1
- quantile这节让詹鹏添加上就好 HOT 13
- what's the emphasis of this book? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play-econometrics-with-r.