Conflit shiny and DT package when R CMD check!

622 views
Skip to first unread message

Ivan Bezerra Allaman

unread,
Dec 4, 2016, 9:05:23 PM12/4/16
to Shiny - Web Framework for R
Dears,

When compiling my shiny app (R CMD check), I get the following message:

Found the following significant warnings:

 Warning: replacing previous import 'shiny :: dataTableOutput' by 'DT :: dataTableOutput' when loading 'EDM'

I have already done my homework in correctly placing in NAMESPACE the function to be imported, but not work.

DESCRIPTION
Package: EDM
Title: Exams Database Manager
Version: 1.0-2
Date: 2016-11-23
Author: Ivan Bezerra Allaman <ivana...@gmail.com>
Maintainer: Ivan Bezerra Allaman <ivana...@gmail.com>
Description: Interactive shiny application for working with exams database
  Managing
License: GPL (> = 2)
Depends: R (> = 3.0.3), shiny, exams, Ruchardet, shinyjs
Imports: DT
NeedsCompilation: no

NAMESPACE
Export (startEDM)

import
  shiny,
  exams,
  Ruchardet,
  DT,
  utils,
  stats,
  shinyjs
  )

ImportFrom (DT, dataTableOutput, renderDataTable)

I do not understand either, because the maintainers of the shiny package have not yet removed the dataTableOutput and renderDataTable functions. If someone helps me I'll be very grateful.

jeremiah rounds

unread,
Dec 4, 2016, 9:28:23 PM12/4/16
to Ivan Bezerra Allaman, Shiny - Web Framework for R
I am not sure what the current status of each project is but Shiny incorporates a DT package that is behind the actual DT package, so there is reason(s) you would see a warning like this.  The author of the DT package says to be sure to use DT::function to specify the namespace when using both, but otherwise I have not personally encountered an issue.



--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/94f8a74d-7462-428e-bf16-1141f051b7a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivan Bezerra Allaman

unread,
Dec 4, 2016, 9:34:01 PM12/4/16
to Shiny - Web Framework for R
Hi Jeremiah,

I'm using DT::dataTableOutput and DT::renderDataTable. That's why I'm not understanding the warnings.

Yihui Xie

unread,
Dec 4, 2016, 10:56:44 PM12/4/16
to Ivan Bezerra Allaman, Shiny - Web Framework for R
If you have used DT::dataTableOutput and DT::renderDataTable in your
package, there is no need to import(DT) or importFrom(DT, ...) in
NAMESPACE. All you need to do is put DT in the Imports field of
DESCRIPTION.

Regards,
Yihui
> --
> You received this message because you are subscribed to the Google Groups
> "Shiny - Web Framework for R" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to shiny-discus...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/shiny-discuss/08e48d50-deae-4eda-b11a-f17b84f9281d%40googlegroups.com.

Ivan Bezerra Allaman

unread,
Dec 5, 2016, 10:17:08 AM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
Hi Yihui,

This does not work. I had already tried that. See notes!!!

Namespace in Imports field not imported from: 'DT'
All declared Imports should be used.

Some light???

Yihui Xie

unread,
Dec 5, 2016, 1:26:15 PM12/5/16
to Ivan Bezerra Allaman, Shiny - Web Framework for R
Is the package source available anywhere? I doubt if you did exactly
what I said: 1. Put DT in Imports in DESCRIPTION; 2. Use
DT::renderDataTable() and DT::dataTableOutput() in your source code.
The R CMD check NOTE said you didn't do 2.

Regards,
Yihui

Ivan Bezerra Allaman

unread,
Dec 5, 2016, 7:23:34 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
Now it has!!!

I doubt if you did exactly 
what I said: 1. Put DT in Imports in DESCRIPTION; 2. Use 
DT::renderDataTable() and DT::dataTableOutput() in your source code

See with your own eyes !!!!!!!!!!!!!!!!

Ivan Bezerra Allaman

unread,
Dec 5, 2016, 7:24:21 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
Following the repository: https://github.com/ivanalaman/EDM
--
\begin{signature} 
<<>>= 
Prof. D.Sc. Ivan Bezerra Allaman 
Coordenador da Área de Estatística
Laboratório de Estatística Computacional
Departamento de Ciências Exatas e Tecnológicas
Universidade Estadual de Santa Cruz 

Ilhéus/BA - Brasil 
Fone: +55 73 3680-5596 
E-mail:ivana...@gmail.com 

\end{signature}

Joe Cheng [RStudio]

unread,
Dec 5, 2016, 7:28:09 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
1. Put DT in Imports in DESCRIPTION;
2. Use DT::renderDataTable() and DT::dataTableOutput() in your source code;
3. Make sure NAMESPACE has *no* mention of DT.

If you've done this and are still seeing warnings/notes, you'll have to send the source package or a URL to the source code.

Joe Cheng [RStudio]

unread,
Dec 5, 2016, 7:29:13 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
Sorry, I was composing my message while you were sending your latest with the GitHub URL.

Joe Cheng [RStudio]

unread,
Dec 5, 2016, 7:43:36 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
The reason you're seeing this is because your Shiny app is in the inst directory, not under R directory. The R CMD check code analyzer only looks at R/.

One quick to get around this would be to make a spurious call to DT somewhere in R/ (like in a function that's not exported or called).

Or the less hacky way is to move your Shiny app (all of the R code) from inst into R. Your startEDM function wouldn't call shiny::runApp on a directory, but instead, return a shiny::shinyApp(ui, server) object. The main difference is that you can't assume anything about the working directory in that case; every time you want to fetch the data files in your inst, you'll have to use system.file. Actually now looking at your code, it looks like you're doing a lot of source-ing of .R files, that would have to be rewritten in a different way (possibly Shiny modules).

Ivan Bezerra Allaman

unread,
Dec 5, 2016, 8:01:42 PM12/5/16
to Shiny - Web Framework for R, ivana...@gmail.com
Jesus!!!! 

To three years I develop this package with your help. Rewriting it already gives me some dismay, because the programming is a bit complex. I tried to follow the model of some shiny packages published in CRAN. More from now on thanks again for the valuable help and suggestion.

Ivan Bezerra Allaman

unread,
Dec 6, 2016, 7:16:26 PM12/6/16
to Shiny - Web Framework for R, ivana...@gmail.com
Joe,

The structure of my package is similar to the IRTShiny package. So I do not understand why such a structure does not work in mine. By the way, I'm having trouble just checking.
Reply all
Reply to author
Forward
0 new messages