Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

cran - Warning: replacing previous import ‘head’ when loading ‘utils’ in R

When loading the RTextTools package from CRAN, I get the following warnings:

Warning messages:
1: replacing previous import ‘head’ when loading ‘utils’
2: replacing previous import ‘tail’ when loading ‘utils’

How do I get rid of these warnings? I'm the author of the package, so I can manipulate the source code; I'm looking for a solution that gets rid of the warnings rather than suppresses them. They seem to have appeared when I upgraded to R 2.14. Thank you in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In general, this problem is often caused by having import(somepackage) in the namespace as well as importFrom(somepackage, somefunction).

Equivalently, using roxgyen2, having both #' @import somepackage and #' @importFrom somepackage somefunction.

The best practice solution is to remove the import statement ans keep only importFrom.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...