cosname / ggplot2-translation Goto Github PK
View Code? Open in Web Editor NEWggplot2一书中文翻译的项目文件
ggplot2一书中文翻译的项目文件
第57页,4.6节第三段第三行:右(right)
应为 右(xmax)
,英文原版也有同样的错误;感谢微博用户@pumcdc 指出
P161
第六行 vp4 <- viewport(x = 1, y = 1, just = c('top', 'right'))
第八行 vp5 <- viewport(x = 0, y = 0, just = c('top', 'right'))
报错 Error in valid.charjust(just) : invalid horizontal justification
just的第一个参数对应水平,第二参数对应垂直。水平是左右,垂直是上下。
似乎应将两个参数对调,改为:
vp4 <- viewport(x = 1, y = 1, just = c("right", "top"))
vp5 <- viewport(x = 0, y = 0, just = c("right", "bottom"))
It seems that xlab should be "Weight(carats)" ylab should be "Price ($)"
运行这段代码qplot(carat,price,data=dsmall,geom = c("point","smooth"),span=0.2)
报错Error: Unknown parameters: span
运行这段代码qplot(carat, price, data = dsmall, geom = c("point", "smooth"),method = "loess",span=0.2)
报错Error: Unknown parameters: method, span
in chap7 's code, line 42:
Error in round_any(movies$year, 10, floor) : 找不到对象'movies'.
查了一下movies数据集应该在ggplot2里,但我加载了后还是报错。。。
####### 图7.3 每十年电影平均评分的分布。
movies$decade <- round_any(movies$year, 10, floor)
####### round_any() 需要加载 plyr 包
qplot(rating, ..density.., data = subset(movies, decade > 1890), geom = "histogram",
binwidth = 0.5) + facet_wrap(~decade, ncol = 6)
环境
ggplot2 中文译本P153以下代码运行时,无法出现plot外框线的效果:
第二行: hgram + theme(plot.background = element_rect(size = 2))
第四行:hgram + theme(plot.background = element_rect())
除非在element_rect里多写一句colour = "black"
各位遇到同样的问题不?
运行提示系统无法判断该如何调用函数,经验证是因为数据集“economics”的“date”格式为因子(可通过str函数查看),需先转换为日期格式(economics$date<-format(economics$date,%Y/%m/%d)),转换后通过str函数可以看到“date”格式变为日期了。
执行 p<-p+layer(geom = "point")时会提示必须要设置stat跟position参数,书上讲的会自动取默认值。
第204页,图C.1 中panel_2_1
应为panel_1_2
。原书错误,译本也忘记了更正,致歉!
hadley大人说可以写,不过写啥呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.