Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Function not found in my R package and not in namespace #532

Open
JasmineLib opened this issue Nov 13, 2018 · 2 comments
Open

Function not found in my R package and not in namespace #532

JasmineLib opened this issue Nov 13, 2018 · 2 comments

Comments

@JasmineLib
Copy link

Hey class!
I'm really at a loss for what is happening. I am trying to add a function to the R package "powers" for hw07, but it seems that it won't recognize the function I am trying to add.
One thing to note, is that in the NAMESPACE file, this function does not show up, although I have exported it (see below).

I've tried restarting R, but beyond this, I have no idea why this function is not being added to the NAMESPACE and/or not being recognized.

This is the code I have:
#'#' Apply a useful root
#'
#'
#'@param x the vector for which you want the root
#'@param y the integer root that you want to take (ie square root = 2, cube root = 3, etc)
#'@param plot_it Display a plot of \code{x} vs the output? Use logical.
#' \code{FALSE} by default.
#'
#'@return A vector that is the:
#' \itemize{
#' \item root (for \code{root})
#'}
#' of \code{x}.
#'
#'
#'@Rdname root
#'@export
root <- function(x, y, plot_it = FALSE) pow(x, a=1/y, plot_it=plot_it)

@JasmineLib
Copy link
Author

screen shot 2018-11-13 at 7 20 09 am

Maybe this is a hint - the warning that comes up after checking the package, though after several searches about what this means, I'm still unsure how to fix my issue.

@MalcolmNSB
Copy link

Not sure if this is helpful or not, but if you check your auto-generated root.Rd file, do you see \usage{ root(x,y) }? If so then I think this file is being written with the wrong \usage{} somehow, since I as far as I understand about R package documentation, it is looking for \usage{ root(x,y,plot_it) } and doesn't find it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants