Skip to content

Question

8 messages · S. Mahmoud Nasrollahi, Sarah Goslee, Bert Gunter +3 more

#
Dear colleague
I have got a problem during working with some package in R and in
spite of trying with R help, internet and any other resources I could
not succeed. Indeed when I what to install some function like bwplot,
boxplot,  xyplot I receive this sort of messages:
 Warning in install.packages :
  package ?xyplot? is not available (for R version 3.5.2)
Do you know how I can solve that?
#
xyplot is not a package, it is a function within the lattice package, which
should already be installed.

library(lattice) # load the package from the R library
?xyplot # look at the help for the function

The others are also functions, not packages.

Sarah

On Tue, Jan 8, 2019 at 9:15 AM S. Mahmoud Nasrollahi <smnasrolahi at gmail.com>
wrote:
#
On Tue, 8 Jan 2019, S. Mahmoud Nasrollahi wrote:

            
Yep. Those plots are part of the lattice package. You can install lattice
(and latticeExtra if you want) with
Happy plotting,

Rich
#
I think it's ?install.packages

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Tue, Jan 8, 2019 at 9:50 AM Rich Shepard <rshepard at appl-ecosys.com>
wrote:

  
  
#
Guys,

lattice is a "recommended" package, which means that it is installed by default with any standard R installation.

Thus, all that is required, as Sarah noted in an earlier reply, is either:

  library(lattice)

or 

  require(lattice)

depending upon preference.

latticeExtra, on the other hand, is a third party package that would need to be installed separately, if desired.

Regards,

Marc Schwartz
#
On Tue, 8 Jan 2019, Bert Gunter wrote:

            
Bert,

   Of course it is. My apologies to the original poster.

Rich
#
On Tue, 8 Jan 2019, Marc Schwartz wrote:

            
Marc,

   Thanks for the reminder.

Regards,

Rich
#
Er, just keep it simple, Marc... give one option:

library(lattice)

If you _ever_ use require() without acting upon the return value then you are setting yourself or someone else up for confusing missing objects errors someday for no good reason. This _isn't_ just personal preference... by choosing to use the require function you are taking responsibility for the case where that package is missing, and by ignoring the return value you are immediately abdicating that responsibility. Let the error appear where it makes sense by using the library function in the first place.
On January 8, 2019 10:56:57 AM PST, Marc Schwartz via R-help <r-help at r-project.org> wrote: