ADP (R)

[R] plot type="b"

멋쟁이천재사자 2022. 9. 19. 15:56

1. 분산 분석 script 를 study 하는 중이었습니다.

interaction.plot(x.factor=ToothGrowth$dose, 
                 trace.factor=ToothGrowth$supp, 
                 response=ToothGrowth$len, 
                 trace.label="Supplement", 
                 las=1,type="b",pch=c(1,19), 
                 xlab="Supplement Dose combination", 
                 ylab="Tooth Growth", 
                 main="Means Plot for Tooth Growth of Guinea Pigs" ) 

출처 : https://youtu.be/tBn9APzzEhc?list=LL&t=1477 

 

2. type="b" 가 궁금합니다.

?interaction.plot
찾아보았지만 딱 맞는 설명이 안보입니다.

3. 어떤 값이 가능할까?

오류를 통해 사용가능한 코드 목록을 확인할 수 있었습니다.
type="x" 를 주고 오류를 일부러 유도해보았습니다.
Error in match.arg(type) : 
  'arg'은 반드시 “l”, “p”, “b”, “o”, “c” 중 하나이어야 합니다

 

4. 구글링

오류에서 확인한 메시지를 응용하여 구글링을 했습니다.
사용한 키워드 : type “l”, “p”, “b”, “o”, “c” R plot
아래 두 개의 내용은 거의 동일합니다.
https://www.rdocumentation.org/packages/graphics/versions/3.6.2/topics/plot
https://r-coder.com/plot-r/

type
what type of plot should be drawn. Possible types are

"p" for points,
"l" for lines,
"b" for both,
"c" for the lines part alone of "b",
"o" for both ‘overplotted’,
"h" for ‘histogram’ like (or ‘high-density’) vertical lines,
"s" for stair steps,
"S" for other steps, see ‘Details’ below,
"n" for no plotting.  

 

5. todo

hsSn 은 interaction.plot 에서는 지원하지 않습니다.
interaction.plot 에 딱 맞는 링크는 아직 찾지 못했습니다.
일부러 찾아보지는 않겠지만, 언젠가 혹시 눈에 띄면 업데이트를 해야겠습니다.

'ADP (R)' 카테고리의 다른 글

오늘의 ADP 준비 / 2022-09-20 화(D5)  (2) 2022.09.20
[R] plot las=1  (2) 2022.09.19
머신러닝 (elasticnet svm rf)  (0) 2022.09.14
[Adp 실기 기출 풀이] 22회 구매패턴 연관성  (0) 2022.09.14
[R] x is not a factor 오류 해결  (0) 2022.09.14