2013-12-20 1 views
2
내가 R.의 시작에 색상 팔레트를 변경하려면

따라서 나는 R의 시작에 내 .Rprofile

palette(c(
    "#2e3436" # (Aluminium 6) 
    , "#ef2929" # (Scarlet Red 1) 
    , "#73d216" # (Chameleon 2) 
    , "#3465a4" # (Sky Blue 2) 
    , "#fcaf3e" # (Orange 1) 
    , "#ad7fa8" # (Plum 1) 
    , "#babdb6" # (Butter 1) 
    , "#babdb6" # (Aluminium 3) 
)) 

에 다음 소스 코드를 복사 다음 메시지가 나타납니다.

Error: Could not fine the function 'palette'

시작할 때 팔레트를 변경할 수 있습니까?

+0

어쩌면'그 전에'라이브러리 (grDevices)를 추가? –

+0

시작시 성가신 창을 엽니 다. .Rprofile 다음에 어떤 패키지가로드되고 정의되어 있습니까? ('palette()'를 호출하기 전에'grDevices'를로드 할 필요가 없었습니다) –

답변

5

Note that when the site and user profile files are sourced only the 'base' package is loaded, so objects in other packages need to be referred to by e.g. 'utils::dump.frames' or after explicitly loading the package concerned.

그래서 대신 palette()?Startup에서 grDevices::palette()를 호출합니다. (dev.off()에 대한 호출이 시작 다음 그렇지 않으면 존재하는 빈 그래픽 창을 제거하기 위해 필요합니다.)

grDevices::palette(c(
    "#2e3436" # (Aluminium 6) 
    , "#ef2929" # (Scarlet Red 1) 
    , "#73d216" # (Chameleon 2) 
    , "#3465a4" # (Sky Blue 2) 
    , "#fcaf3e" # (Orange 1) 
    , "#ad7fa8" # (Plum 1) 
    , "#babdb6" # (Butter 1) 
    , "#babdb6" # (Aluminium 3) 
)) 

grDevices::dev.off()