HOME > 紫 > R <
R <
若吾吟吾сS 篋違 R 篏帥<≪ R R 篏帥違R <≪鐚紜茖壕鐚篏
腟沿純 R 泣障篏帥堺綽с<≪
R CRAN (The Comprehensive R Archive Network) http://cran.r-project.org/ ユсャ≪祉ャ≪pdf 2040 若吾鐚鐚鐚
絖吾с
吾с篁吾с筝障馹
紊荐茯с医ゃ違吾с医ゃ泣吾с絋R 違篁ヤ v s 紊絎違激 1 3 с吾с激馹с鐚篁罕 R 篏帥for 若吾c鐚
> s <- 1 > s [1] 1 > v <- c(1, 2, 3) > v [1] 1 2 3
筝 v 医ゃ冴[ ] 羞糸 0 с 1 紮障
> v[2] [1] 2
s v 篁吾с障с絖(atomic)吾с泣蕁
> is.atomic(s) [1] TRUE > is.atomic(v) [1] TRUE
絖絖吾с
> c <- "Hello." > c [1] "Hello." > is.atomic(c) [1] TRUE
鴻吾с激灸ゃ絮фゃ
> mode(s) [1] "numeric" > length(s) [1] 1 > mode(v) [1] "numeric" > length(v) [1] 3 > mode(c) [1] "character" > length(c) [1] 1
null 腥冴logical 純numeric 絎違complex 茲膣違character 絖
с吾с激 1 с篁ヤс馹
> s <- 1 > v <- c(1, 2, 3) > mode(s) [1] "numeric" > mode(v) [1] "numeric"
c( ) ∽違篏帥筝ゃ吾с障с∞茵違綣桁句紊
> mode(1) [1] "numeric" > mode("abc") [1] "character" > mode(c(1, "abc")[1]) [1] "character" # numeric c 1 character 紊
鴻
絖吾с鴻泣
∽ list() 鴻篏
> L <- list(1, 2, 3) > L [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 > is.atomic(L) [1] FALSE
鴻鴻激荀膣違
> mode(L) [1] "list" > length(L) [1] 3
v 絋鴻鴻
> is.list(L) [1] TRUE > is.list(v) [1] FALSE
鴻荀膣冴 [[ ]]
> L[[2]] [1] 2
鴻荀膣鴻緇 [ ]
> L[2] [[1]] [1] 2
[[ ]] [ ] 阪ャ紊т
> mode(L[[2]]) [1] "numeric" > mode(L[2]) [1] "list"
鴻違吾с緇
> p <- list(1, "one") > p [[1]] [1] 1 [[2]] [1] "one"
絮т
吾с激祉篁紙絮с筝吾с
> attr(s, "english")="one" > attr(s, "english") [1] "one"
(mode)激(length)(names)篁ュ絮с吾с若吟筝腓鞘х絎臂違c羈綽荀с
絖吾с | s <- 1 v <- c(1,2,3) | attr(s, "english") <- "one" attr(v, "english") <- "one to three" | 絖吾с | L <- list(1,2,3) | attr(L, "english") <- "list of one to three" |
---|
鐚mode length names 篁ュ鐚絮с吾ссc(1, 2, 3) с1 障罕сc(1, 2, 3) names 篁ュ絮с篁違с荐
>