\code{\link{function-name}} in roxygen2
Asked Answered
U

1

7

It is my first experience in writing an R-package. I used roxygen2 by following the instructions given in this link http://kbroman.org/pkg_primer/

Everythig is working fine except few things.. there could be a simpler solution to solve the issues, but I am not finding clues what I am doing wrong. I hope someone here in this blog can give a solution to solve my issues.

First issue is about {\code\link{function-name}} in roxygen2: In .R script I inlcuded this line:

#' @seealso \code{\link{s2a}} 

After documenting (generating .Rd files) there is no hyperlink to s2a , in documentation s2a shows like a normal text not like hyperlink.. export(s2a) is listed out in NAMESPACE. Is there any other place i need to modify ?

Second issue is about data(): I saved the dataset in .Rdata format and placed in the data/ in package directory. I also created the .R script in R/ as like following steps here http://kbroman.org/pkg_primer/pages/data.html

In DESCRIPTION file LazyData: true .

but when I type data(shh) in R console gives a warning message

data(shh) Warning message: In data(shh) : data set ‘shh’ not found

Any ideas is of great help:)

Ushijima answered 13/4, 2015 at 8:45 Comment(4)
#' @seealso \code{\link{s2a}}Ushijima
did you try @seealso \link{s2a} without the code tag ?Chak
@MamounBenghezal : Yes i tried, it doesnt work either.Ushijima
I also have same problem, I wonder it goes well for the other computer when someone download my package ?Encamp
A
17

It's been a while since you asked this, but I was having the exact same problem with hyperlinks in documentation not appearing correctly, so for anyone who might be having a similar problem: Are you possibly viewing the development documentation? The links don't seem to work there. (You'll know this is the case if you see Using development documentation for your_function_name in your console output when you run ?your_function_name.)

The links should appear in the non-development documentation. To generate this you can try building and reloading your package, for instance by following the steps here: http://r-pkgs.had.co.nz/man.html#man-workflow-2

Ape answered 18/10, 2017 at 18:14 Comment(1)
I had the same problem and generating non-development documentation solved it, thanks.Carbolated

© 2022 - 2024 — McMap. All rights reserved.