Giter VIP home page Giter VIP logo

Comments (13)

kohske avatar kohske commented on September 1, 2024

hi,

scales depends on other few packages.

try

> install.packages('munsell', dep=TRUE)

and run the example.

from scales.

yihui avatar yihui commented on September 1, 2024

Thanks. I did install munsell. I think the problem is likely to come from the fact that R begins to force LazyData: TRUE in packages, or someone did not really make this commit into the package: cwickham/munsell@a5660c1 So this may be a bug of munsell.

from scales.

hadley avatar hadley commented on September 1, 2024

Can you please provide the output of sessionInfo?

from scales.

yihui avatar yihui commented on September 1, 2024
> library(scales)
>  x <- seq(0, 1, length = 25)
>  show_col(seq_gradient_pal()(x))
Error in match(col, munsell.map$name) : object 'munsell.map' not found
>  show_col(seq_gradient_pal("white", "black")(x))
> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] scales_0.1.0

loaded via a namespace (and not attached):
[1] colorspace_1.1-0   dichromat_1.2-3    munsell_0.2        plyr_1.6          
[5] RColorBrewer_1.0-5 stringr_0.5       

> library(munsell)  # problem is fixed when munsell is loaded
>  show_col(seq_gradient_pal()(x))  # OK

from scales.

kohske avatar kohske commented on September 1, 2024

I found that the error occurs in my environment. my session info:

> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] ja_JP.UTF-8/ja_JP.UTF-8/C/C/ja_JP.UTF-8/ja_JP.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] scales_0.1.0 devtools_0.3

loaded via a namespace (and not attached):
[1] colorspace_1.0-1   dichromat_1.2-3    munsell_0.2        plyr_1.5.1         RColorBrewer_1.0-2 stringr_0.4    

from scales.

kohske avatar kohske commented on September 1, 2024

actually munsell.map is not exported from munsell, so it is not available after importing the exports into scales namespace.
Is this know problem in R-dev?

from scales.

kohske avatar kohske commented on September 1, 2024

then, should munsell be listed in "depends" instead of "imports" in DESCRIPTION file, since munsell must be attached?

http://cran.r-project.org/doc/manuals/R-exts.html#The-DESCRIPTION-file

from scales.

hadley avatar hadley commented on September 1, 2024

That's a weird error, but I think the basic problem is that in seq_gradient_pal etc. I should have munsell::mnsl("10B 4/6") in the defaults.

from scales.

kohske avatar kohske commented on September 1, 2024

Did you find this description in the R-exts.html?

The general rules are

  • Packages whose name space only is needed to load the package using library(pkgname) must be listed in the ‘Imports’ field and not in the ‘Depends’ field.
  • Packages that need to be attached to successfully load the package using library(pkgname) must be listed in the ‘Depends’ field, only.
  • All packages that are needed to successfully run R CMD check on the package must be listed in one of ‘Depends’ or ‘Suggests’ or ‘Imports’. Packages used to run examples or tests conditionally (e.g. via if(require(pkgname))) should be listed in ‘Suggests’ or ‘Enhances’. (This allows checkers to ensure that all the packages needed for a complete check are installed.)

from scales.

hadley avatar hadley commented on September 1, 2024

Yes, I'm quite aware of that. I'm trying to minimise the use of depends and maximise the use of imports because it's better development practice: you're less likely to have/cause problems with other packages.

from scales.

kohske avatar kohske commented on September 1, 2024

aha, it sounds nice.

from scales.

yihui avatar yihui commented on September 1, 2024

since this issue has already been solved, any plans on releasing the github version of munsell to CRAN?

from scales.

hadley avatar hadley commented on September 1, 2024

Sure, just as soon as I get latex working on my computer again :/

from scales.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.