Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roxygen2 #9

Open
jenessalemon opened this issue Nov 18, 2016 · 15 comments
Open

roxygen2 #9

jenessalemon opened this issue Nov 18, 2016 · 15 comments

Comments

@jenessalemon
Copy link
Collaborator

jenessalemon commented Nov 18, 2016

@willpearse Hey Will, I took out everything that is not an actual function, removed all non-code, and got the same error. For some reason roxygenize won't run either. Here's the error:

I am trying to run it through plants_pack.R, lines 1-3.

roxygenize("/Users/jimblotter/Desktop/Grad School/Programming_for_Biologists/r-world-jenessalemon")
First time using roxygen2. Upgrading automatically...
Error in read.dcf(file, keep.white = "Authors@R") :
cannot open the connection
In addition: Warning message:
In read.dcf(file, keep.white = "Authors@R") :
cannot open compressed file '/Users/jimblotter/Desktop/Grad School/Programming_for_Biologists/r-world-jenessalemon/DESCRIPTION', probable reason 'No such file or directory

Except there IS such file! I can see it by navigating to r-world-jenessalemon in my Finder window. So I'm not sure what to do. I'm wondering if you will have time to help me see what is going on. I NEED to be able to complete the package or my grade is doomed... If there is a waiting list, put me on it!

@willpearse
Copy link
Member

You're using words like "doomed" and all caps. I have sympathy, but (1) panicking never helped anyone and (2) if you had done this in the session on Monday, as I told the entire class to do, then you wouldn't be in this situation.

You need to run roxygen on the folder that contains your package. /Users/jimblotter/Desktop/Grad School/Programming_for_Biologists/r-world-jenessalemon/ is not your package. /Users/jimblotter/Desktop/Grad School/Programming_for_Biologists/r-world-jenessalemon/RWorld is your package.

@jenessalemon
Copy link
Collaborator Author

I got like 100 errors. I can't copy and past them all in here, because there is a "Updating Loaded Packages" window that pops up asking me if I want to restart R, and no matter whether I push Cancel, No, or Yes, it pops up again. But the errors say:

Error in install.packages : Updating loaded packages
First time using roxygen2 : Upgrading automatically

And their might be more errors at the top, but I can't see them because the window that pops up won't go away. It's quite resilient, you see. So, to me it seems like this error is saying that the package is already loaded, so it can't add the help files. I would think the package has to be made in order to add help files, or there would be no help files to add to! To confirm this I deleted my package and ran it again and was right, there were errors saying that the package didn't exist. So I'm guessing that is not what the error messages mean, and I'm wondering if you know what they mean.

@willpearse
Copy link
Member

Push your new version of the package to github and i will take a look at it.

make a comment here when you have pushed it up

@jenessalemon
Copy link
Collaborator Author

Done

@willpearse
Copy link
Member

OK, a few things:

  • You've not run Roxygen on the package (i.e., you've not typed roxygenize("r-world-jenessalemon/RWorld")
  • You've got code in your package that isn't defining functions. For example, you have the line install.packages('roxygen2') at the start of your plants_pack.R file. Get rid of anything in those files that doesn't define a function - nothing else should be in there

...if you do that, then (wonderfully!) you're basically there. The other error messages you'll get make perfect sense (e.g., "undocumented arguments for function XXX" where you haven't documented an argument in function XXX).

@willpearse
Copy link
Member

to be clear: you need to run roxygenize, you don't need to type it into a file. You type it into the R console, not the file.

@jenessalemon
Copy link
Collaborator Author

Ok, I've removed the first three lines (that weren't part of a function.) I still get the same error. I would appreciate it if you could call me on Skype if you are available! Not sure what's going on here.

@willpearse
Copy link
Member

I can't I'm afraid. If you had given me an error message I might be able to
help more.

When I made the changes I suggested, it all looked a lot better...
On Fri, 18 Nov 2016 at 17:50, jenessalemon [email protected] wrote:

Ok, I've removed the first three lines (that weren't part of a function.)
I still get the same error. I would appreciate it if you could call me on
Skype if you are available! Not sure what's going on here.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABLcUiuRjWIbpCfharof4xVlboWZOF1sks5q_eV5gaJpZM4K2DLA
.

@jenessalemon
Copy link
Collaborator Author

When I said I got the same error I meant:
I can't copy and past them all in here, because there is a "Updating Loaded Packages" window that pops up asking me if I want to restart R, and no matter whether I push Cancel, No, or Yes, it pops up again. But the errors say:

Error in install.packages : Updating loaded packages
First time using roxygen2 : Upgrading automatically

And their might be more errors at the top, but I can't see them because the window that pops up won't go away. It's quite resilient, you see. So, to me it seems like this error is saying that the package is already loaded, so it can't add the help files. I would think the package has to be made in order to add help files, or there would be no help files to add to! To confirm this I deleted my package and ran it again and was right, there were errors saying that the package didn't exist. So I'm guessing that is not what the error messages mean, and I'm wondering if you know what they mean.

@willpearse
Copy link
Member

I will say this again: when I made the changes I described to you, this
went away...
On Fri, 18 Nov 2016 at 17:56, jenessalemon [email protected] wrote:

When I said I got the same error I meant:

I can't copy and past them all in here, because there is a "Updating
Loaded Packages" window that pops up asking me if I want to restart R, and
no matter whether I push Cancel, No, or Yes, it pops up again. But the
errors say:

Error in install.packages : Updating loaded packages
First time using roxygen2 : Upgrading automatically

And their might be more errors at the top, but I can't see them because
the window that pops up won't go away. It's quite resilient, you see. So,
to me it seems like this error is saying that the package is already
loaded, so it can't add the help files. I would think the package has to be
made in order to add help files, or there would be no help files to add to!
To confirm this I deleted my package and ran it again and was right, there
were errors saying that the package didn't exist. So I'm guessing that is
not what the error messages mean, and I'm wondering if you know what they
mean.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABLcUm9hqqP4kcT-4ozqFsu0j0RnYW-_ks5q_ebFgaJpZM4K2DLA
.

@jenessalemon
Copy link
Collaborator Author

jenessalemon commented Nov 18, 2016

@willpearse Ok I worked through it with a small package with a single function like you suggested in the announcements and I am really really close here. I got roxygenize to generate my help files (I think, it's pushed if you have time to check it out.) So I am now trying to check my package.
Question that you will probably think is silly: How do I tell R Studio to check my RWorld package rather than my Test package? I can't figure out how to change the directory. So far I have tried:

  1. opening all the files in RStudio.
  2. navigating to RWorld in the "Files" menu.

It is still checking Test though.

@Wolflab any ideas?
@sylviakinosian ?

@jenessalemon
Copy link
Collaborator Author

@willpearse
I tried this too:

setwd("~/Desktop/Grad School/Programming_for_Biologists/r-world-jenessalemon/RWorld")

@jenessalemon
Copy link
Collaborator Author

I figured out how to run it from command line.

@jenessalemon
Copy link
Collaborator Author

This is what I said when I said I got 100 errors:

"I got like 100 errors. I can't copy and past them all in here, because there is a "Updating Loaded Packages" window that pops up asking me if I want to restart R, and no matter whether I push Cancel, No, or Yes, it pops up again. But the errors say:

Error in install.packages : Updating loaded packages
First time using roxygen2 : Upgrading automatically"

I did tell you what the errors say. And I was saying that the same error was repeated 100 times, and it was for all I could tell.

@willpearse
Copy link
Member

Let's talk about this when it's your turn for the one-on-one sessions - I think some things are easier to discuss "in person"

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

No branches or pull requests

2 participants