Re: [geomorph-r-package] plot.advanced.procD.lm

75 views
Skip to first unread message

Antigoni Kaliontzopoulou

unread,
May 31, 2018, 10:19:41 AM5/31/18
to geomorph-...@googlegroups.com

Avi, this is a generic plot. function, not a stand-alone one. It works on an object that is the result of an advanced.procD.lm analysis. Please read the examples in the help file of advanced.procD.lm more carefully.

Antigoni


On 31/05/2018 15:03, netbird....@gmail.com wrote:
Hi,
I saw this new function in the guide (pdf) for version 3.0.6, but although I updated to ver. 3.0.6 and could reach the help for that function in R, when running the function I get:
"could not find function "plot.advanced.procD.lm"
Does anyone know why I get this error?
Thanks,
Avi
--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/d360181f-738f-4161-96c2-cea9fec5d0a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Antigoni Kaliontzopoulou 

Assistant Researcher
CIBIO/InBIO, Centro de Investigação em Biodiversidade e Recursos Genéticos
University of Porto
Campus Agrário de Vairão, 4485-661 Vairão
PORTUGAL

https://cibio.up.pt/research-groups-1/details/phenevol
http://cibio.up.pt/people/details/akaliont
http://antigonik.wix.com/akaliontzopoulou

netbird....@gmail.com

unread,
May 31, 2018, 10:34:48 AM5/31/18
to geomorph R package
Hi Antigoni,
I got this error after running this function on the result of an advanced.procD.lm analysis.
At first I thought that the 'geomorph' package was not loaded, but other functions (e.g. advanced.procD.lm) works.
Avi

On Thursday, May 31, 2018 at 5:19:41 PM UTC+3, Antigoni Kaliontzopoulou wrote:

Avi, this is a generic plot. function, not a stand-alone one. It works on an object that is the result of an advanced.procD.lm analysis. Please read the examples in the help file of advanced.procD.lm more carefully.

Antigoni


On 31/05/2018 15:03, netbird....@gmail.com wrote:
Hi,
I saw this new function in the guide (pdf) for version 3.0.6, but although I updated to ver. 3.0.6 and could reach the help for that function in R, when running the function I get:
"could not find function "plot.advanced.procD.lm"
Does anyone know why I get this error?
Thanks,
Avi
--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.

Antigoni Kaliontzopoulou

unread,
May 31, 2018, 11:16:12 AM5/31/18
to geomorph-...@googlegroups.com

I am sorry, Avi, I did not understand you correctly, then. However, the function seems to work alright for me here, so it is difficult to provide a general answer to what is causing you that error.

Have you tried re-installing, or installing from github (use the Stable version) instead of CRAN?

Antigoni

To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.

To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

For more options, visit https://groups.google.com/d/optout.

Mike Collyer

unread,
Jun 1, 2018, 4:16:35 AM6/1/18
to geomorph-...@googlegroups.com
Avi,

I also could not replicate your error and it is a very strange error, as plot.advanced.procD.lm is definitely a function in geomorph.  Sometimes I run into these kind of errors if I put functions in the global environment (copy a function from a package and modify it for my own use), which means that an S3 generic - which plot.advanced.procD.lm is - is in a different environment than where R now thinks to look for it.

Good luck!
Mike

netbird....@gmail.com

unread,
Jun 4, 2018, 12:51:36 PM6/4/18
to geomorph R package
Hi,

Since other geomorph functions works fine and even looking in the help section using "?plot.advanced.procD.lm" finds the function, I tend to think it isn't something related to the environment (though I'm using R and rstudio portable versions). I bet my syntax is wrong, but I can't find what. If no additional arguments are necessary but the advanced.procD.lm model, then I have no idea what I'm doing wrong.

I use geomorph ver. 3.0.6 - was this function changed through small changes between CRAN and github? anyway, I guess I can give it a try.

Thank you both,

Avi

Mike Collyer

unread,
Jun 4, 2018, 1:21:46 PM6/4/18
to geomorph-...@googlegroups.com
I believe I know what you are doing wrong.  The plot.advanced.procD.lm function is an S3 generic function.  What this means is that it can be used as a generic function, like plot, and the .advanced.proc.D.lm portion indicates to R what kind of class the object has, so it knows how to plot it.

If you are doing this:

plot.advanced.procD.lm(fit)

it will not work, but this will:

plot(fit)

I had not considered when I was trying to confirm if it works that one might type the entire function name.  When I just tried to do that, I got the same error you had.

I’ll re-iterate what Antigoni said before, that the advanced.procD.lm examples demonstrate this.  It might not be apparent, and it can be confusing because all functions must be listed in the index, but S3 generic functions never use the full name.  Whenever you see, e.g., print.procD.lm, summary.procD.lm, plot.procD.lm, you should realize that to make the functions work you use merely use print, summary, and plot, respectively.

Hope that helps!
Mike

To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.

To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

netbird....@gmail.com

unread,
Jun 4, 2018, 1:54:10 PM6/4/18
to geomorph R package
Hi Mike,
You're right. I used plot.advanced.procD.lm(fit), and though I was able to use plot(fit) I thought plot.advanced.procD.lm(fit) is a different function that would give something else.
Thank you,
Avi

Mike

Reply all
Reply to author
Forward
0 new messages