rbasic_revised's Issues
#55
很酷
#100
在windows 7
tmp <- read.table('cl_info_other.csv', sep = ',',stringsAsFactors = F, header = T, nrows = 1000)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 1 did not have 14 elements
可用read.csv
page 40(and following subtitle)
第二行是多餘的,還是數字?
p63頁
建議加入str函數 說明my_data變數的class
#125
希望可以有產生magic vector的code chunk
P158-P159 標題問題
希望標題能增加 (1/2) (2/2)
ubuntu cannot run say command ...
- please replace the following codes:
for (i in 1:5){
system("say 'Nann Moll Ah Mi Tow Fo'")
system("say 'Ah Men'")
}
- with
for (i in 1:5){
system("espeak 'Nann Moll Ah Mi Tow Fo'")
system("espeak 'Ah Men'")
}
#21 直接加上is.na(a)的效果
R Markdown第45頁Rmd File無法直接貼上使用。
R Basic的第99頁簡報,cl_info_other.csv資料建議放到套件中。
如題,避免現場一陣忙亂XD
P.158-159頁少三個括號.
如題。
p121, 122 逗號不一致
1.45284450 ,-0.04625854 vs 1.45284450, -0.04625854
factor(), data.frame()
Add intro to factor() and data.frame()
R Basic的第124頁簡報,MLDM_RBasic_ForLoop_Ex.RData資料建議放到套件中。
如題! 謝謝大大!
espeak error msg on Ubuntu 12.04 (p.122)
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
#145
用 utils::browseURL 使用預設瀏覽器打開 .R 檔案
R Markdown第31頁圖片無法顯示,建議可以加入圖片連結。
#138 Matrix Transpose
忘了寫 t() .....
#158 and 159
少了三個 "}"
[Win8] #100
[win8] cl_info_other.csv 要改成 cl_info_other_windows.csv 才讀的了
espeak command for windows
P158-P159程式碼不知道怎麼貼才會執行
as title
[WIN 8.1] Template 檔中文註解顯示亂碼 (p. 147, p. 149, p. 159)
OS: Windows 8.1
P.147
path <- DSC2014Tutorial::Basic_file("barnsley_fern_template.R")
utils::browseURL(path)
P.149
path <- DSC2014Tutorial::Basic_file("barnsley_fern_answer.R")
utils::browseURL(path)
P.159
path <- DSC2014Tutorial::Basic_file("battleship_template.R")
utils::browseURL(path)
template 檔中文註解顯示亂碼。
p.22 依續->依序
R Markdown第54頁的程式碼%>%無法使用
mtcars %>%
ggvis(x = ~wt, y = ~mpg) %>%
layer_smooths(se=TRUE, opacity := 0.5, opacity.hover := 0.75) %>%
layer_points(fill = ~factor(cyl), size := 50, size.hover := 200) %>%
set_options(hover_duration = 250)
Error: could not find function "%>%"
Error: unexpected SPECIAL in "%>%"
R Basic的第156頁簡報,Template無法使用
battleship <- function(num_guess){
由電腦隨機決定一組坐標。
ship_x <- _____
ship_y <- _____
初始的地圖。
map =list(c('O', 'O', 'O', 'O', 'O'),
c('O', 'O', 'O', 'O', 'O'),
c('O', 'O', 'O', 'O', 'O'),
c('O', 'O', 'O', 'O', 'O'),
c('O', 'O', 'O', 'O', 'O'))
描繪地圖。
for (row in map){
______
}
trial: 玩家已猜測次數。
trial <- 0
while (){
# 玩家選定坐標 x 與 y 。
x <- as.numeric(readline('Guess the x:'))
y <- as.numeric(readline('Guess the y:'))
# 根據玩家選定之 x 與 y 更新 map。
map[[**]][**] <- 'X'
# 繪製地圖。
for (){
print(row)
}
# 根據玩家猜測的結果,顯示適當資訊與更新相關變數。
if (________){
cat('Oh NO~~~You shrink my boat!!')
break
} else{
cat('You miss.')
trial <- ____
}
# 當玩家用完所有機會,顯示遊戲結束的訊息與電腦的 x 與 y 坐標。
if (_______){
cat('You loss.\n')
cat("The battleship's x-coordinate is", ship_x, '\n')
cat("The battleship's y-coordinate is", ship_y, '\n')
}
}
}
R Markdown第30頁的連結中文無法顯示(Win8.1)
註解部分的建議 (p.160)
建議將
sample.int(5, 1) # 從 15 中隨機抽取 1 個數字。5 中隨機抽取 1 個正整數。
修改為
sample.int(5, 1) # 從 1
p156
Template 可以放到https://gist.github.com/, 然後用iframe improt進來
159頁
while (trial < num_guess){
x <- as.numeric(readline('Guess the x:'))
y <- as.numeric(readline('Guess the y:'))
if (x <= 5 && y <= 5 && x > 0 && y > 0){
map[[y]][x] <- 'X'
for (r in map){
print(r)
}
if (x == ship_x & y == ship_y){
cat('Oh NO~~~You shrink my boat!!')
break
} else{
cat('You miss.')
trial <- trial + 1
}
下面少兩個括號
R Basic的第146頁簡報,Template畫不出來
畫不出來 冏
rm(list = ls())
set.seed(3690)
設定起始點為 (0, 0) 的行向量。(以矩陣表示)
p = matrix(c(0, 0), ncol = 1)
建立名為 coord 的 data.frame。
coord = rbind(data.frame(), t(p))
for () {
# 從 uniform(0, 1) 中抽取 indicator 決定當次遞迴式。
indicator = runif(1, 0, 1)
# 根據抽樣結果決定遞迴式。
if (indicator <= 0.05) {
m = __________
const = matrix(c(0, 0), ncol = 1)
} else if () {
m = matrix(c(0.85, -0.04, 0.04, 0.85), nrow = 2, ncol = 2)
const = ______
} else if (____) {
m = ______
const = ______
} else {
m = ______
const = ______
}
# 計算新的 p 坐標值。
p = _______
# 將新的 p 點坐標合併至 coord 中。
coord = _______
}
作圖。
plot(x = coord[, 2], y = coord[, 1], plt = c(0, 10, -5, 5), cex = 0.1, asp = 1)
p159頁的括號有缺?
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.