Skip to content

problem with function "polygon"

3 messages · Eric Elguero, Duncan Murdoch

#
Hi all,

I'm trying to use the polygon function from
the graphics package, and get this error
message :

 > polygon(x=c(1,2,3,1),y=c(1,4,5,1))
Error in .Internal(polygon(xy$x, xy$y, col, border, lty, ...)) :
   there is no .Internal function 'polygon'

That annoys me because polygon is actually
called by several other functions I need.

my R version:

R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

and I just updated everything.

e.e.
#
On 07/11/2014 10:05 AM, Eric Elguero wrote:
You are not using the polygon() function from the graphics package, 
you're using one coming from somewhere else (maybe an old version of R, 
or some package).  The polygon() function in the graphics package 
doesn't call .Internal(polygon(..., it calls

.External.graphics(C_polygon, ...

This is one reason why it's a really bad idea to say "yes" when asked 
whether you want to save your R workspace.  If at some point you made a 
copy of the polygon() function and saved it, you're stuck with that one 
forever (or at least until you delete it from your workspace, or even 
better, delete the whole saved workspace).

Duncan Murdoch
#
On 11/07/2014 04:35 PM, Duncan Murdoch wrote:

            
you're absolutely right. I was usin a "polygon" function
from package ade4 (that I copied to my workspace, don't
remember why). I will ask ade4 developpers.

thank you.

e.e.