day1_exercise3
Differences
This shows you the differences between two versions of the page.
| day1_exercise3 [2017/12/13 18:12] – created hyjeong | day1_exercise3 [2021/03/17 13:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | #1 | ||
| + | dat=read.csv(file=' | ||
| + | #2 | ||
| + | head(dat) | ||
| + | #3 | ||
| + | dim(dat) | ||
| + | #4 | ||
| + | write.table(dat[, | ||
| + | #5 | ||
| + | x=dat[, | ||
| + | head(x) | ||
| + | write.table(x, | ||
| + | #6 | ||
| + | y=dat[nchar(dat[, | ||
| + | dim(y) | ||
| + | write.table(y, | ||
| + | #7 | ||
| + | sum(is.na(dat)) | ||
| + | #8 | ||
| + | which(is.na(dat)) | ||
| + | #9 | ||
| + | which(is.na(dat), | ||
| + | #10 | ||
| + | index=which(is.na(dat), | ||
| + | dat[index]=10 | ||
| + | sum(is.na(dat)) | ||
| + | dat[index] | ||
