On Jan 24, 2023, at 5:00 AM, r-help-request at r-project.org wrote:
?
Send R-help mailing list submissions to r-help@?r-project.?org To subscribe or
unsubscribe via the World Wide Web, visit
https:?//urldefense.?proofpoint.?com/v2/url?u=https-3A__stat.?ethz.?ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&eZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Send R-help mailing list submissions to
r-help at r-project.org
To subscribe or unsubscribe via the World Wide Web, visit
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&eor,
via email, send a message with subject or body 'help' to
r-help-request at r-project.org
You can reach the person managing the list at
r-help-owner at r-project.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."
Today's Topics:
1. Re: Info files in Windows and Mac distributions (Duncan Murdoch)
2. Re: [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni) (Jorgen Harmse)
3. Re: [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni) (akshay kulkarni)
4. package FactoMineR (varin sacha)
5. Re: package FactoMineR (Rui Barradas)
6. Re: Flickering when scrolling in R graphics windows
(Martin Maechler)
7. Re: package FactoMineR (PIKAL Petr)
----------------------------------------------------------------------
Message: 1
Date: Sun, 22 Jan 2023 12:38:13 -0500
From: Duncan Murdoch <murdoch.duncan at gmail.com>
To: Naresh Gurbuxani <naresh_gurbuxani at hotmail.com>, R Help
<r-help at r-project.org>
Subject: Re: [R] Info files in Windows and Mac distributions
Message-ID: <6a1cb904-fd30-7686-9f7f-3d28e9b63bb5 at gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
On 22/01/2023 12:09 p.m., Naresh Gurbuxani wrote:> Recently I installed Linux on my desktop. I discovered that R for Linux
ships with info files of manuals. R for Windows and Mac only ship with html and
pdf files of manuals.
>
> Why not include info files in R distributions for Windows and Mac? These
are very convenient with emacs. Using pandoc , I tried converting from html to
info. The results were nowhere near as good as the originals.
I think the answer to the question is just that there isn't much demand
for them: emacs is mainly used by Linux users these days.
But the source to the manuals is available, so presumably you could
produce these pretty easily yourself. The R-devel versions are here:
urldefense.proofpoint.com/v2/url?u=https-3A__github.com_r-2Ddevel_r-2Dsvn_tree_master_doc_manual&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=XnWhnshtwyINVkabbrzkIYLCxHOxWnBrO3Jemc-Mqcw&e
I don't know whether the .texi files are sufficient for emacs or whether
you need to process them first; I'm not an emacs user.
Duncan Murdoch
------------------------------
Message: 2
Date: Mon, 23 Jan 2023 16:01:15 +0000
From: Jorgen Harmse <JHarmse at roku.com>
To: "r-help at r-project.org" <r-help at r-project.org>, akshay
kulkarni
<akshay_e4 at hotmail.com>
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni)
Message-ID:
<MW4PR01MB6465AAB90079281B2151D808DCC89 at
MW4PR01MB6465.prod.exchangelabs.com>
Content-Type: text/plain; charset="utf-8"
Hi Akshay,
I usually use debug (a function provided by R). When you are stepping through a
function your environment is the one in which function code is being executed,
so you can easily see everything that is visible to the function. If you single
step into a function that the first function calls then you also see everything
that is available to that function. Moreover, you don't see anything that is
not visible to the function you are debugging, so you can really determine what
any piece of code would do if called inside the function.
Note 1: Code in R is always executed in an environment. I show in the example
below that in the empty environment (the ultimate ancestor of all other
environments) R can't even add. Usually the current environment (e.g.
.GlobalEnv at the command line or a fresh environment created by a function
call) has the right contents and the right parent to do what you expect, but in
some special cases you need to understand how environments work. Even evalq
& with are functions (unavailable for example in the empty environment), and
the environment argument has to be evaluated in the current environment before
the main expression can be evaluated in the environment that you want.
> E[1]
[[1]]
<environment: R_EmptyEnv>
> evalq(2+2, E[[1L]])
Error in 2 + 2 : could not find function "+"
> evalq(2L+2L, E[[1L]])
Error in 2L + 2L : could not find function "+"
Note 2: Besides automatically showing what a function sees, using debug (instead
of hand-executing lines of code from the function) gives you the correct call
stack. Suppose that you run some code at the debug command line to make a
sub-sub-?-function do what you want, and you create in that environment what you
hope is the correct return value. You can then use parent.frame() to put that
value into the environment of the caller and run the caller's remaining code
in the correct environment to see what happens. If there are no other problems
then you can work your way up to top level and confirm that your patch has the
right effect before you even modify the actual code of the offending function.
(Saving all environments in .GlobalEnv forces R to keep them even if you quit
the debugger. Combining eval & parse is sometimes more convenient than using
evalq.)
Regards,
Jorgen.
------------------------------
Message: 2
Date: Sun, 22 Jan 2023 14:25:59 +0000
From: akshay kulkarni <akshay_e4 at hotmail.com>
To: Jorgen Harmse <JHarmse at roku.com>, "r-help at
r-project.org"
<r-help at r-project.org>, "williamwdunlap at gmail.com"
<williamwdunlap at gmail.com>
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni)
Message-ID:
<PU4P216MB1568BDE0E4929806E096CC11C8CB9 at
PU4P216MB1568.KORP216.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset="utf-8"
Dear Jorgen,
regrets to reply this late....
I got into this issue because it threw an error, and it took more than 4 days to
fix this. I learnt a lot, and one things I learnt is to debug the function,
even when that is a public package function....instead of googling the error
message...Any ideas on how to do this more efficiently?
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jorgen Harmse <JHarmse at roku.com>
Sent: Friday, January 20, 2023 11:35 PM
To: akshay kulkarni <akshay_e4 at hotmail.com>; r-help at r-project.org
<r-help at r-project.org>; williamwdunlap at gmail.com <williamwdunlap
at gmail.com>
Subject: Re: [EXTERNAL] Re: function doesn't exists but still runs.....
(akshay kulkarni)
Hi Akshay,
Lexical scoping and environments are closely tied. (I think Bill even cited the
documentation.) I guess it's arcane in the sense that scoping usually does
what you expect, but the way that works is related to what we discussed.
What led you to discover the issue? Were you debugging the public package
function because it didn't do what you expected, or were you just curious
how it worked?
Regards,
Jorgen.
From: akshay kulkarni <akshay_e4 at hotmail.com>
Date: Friday, January 20, 2023 at 11:19
To: Jorgen Harmse <JHarmse at roku.com>, r-help at r-project.org
<r-help at r-project.org>, williamwdunlap at gmail.com <williamwdunlap
at gmail.com>
Subject: [EXTERNAL] Re: function doesn't exists but still runs..... (akshay
kulkarni)
Dear Jorgen,
thanks for the reply.....so according to you one can pegion
hole the problem as concerning R's lexical scoping rules,am I right? Or some
arcane concept regarding environments....?
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jorgen Harmse <JHarmse at roku.com>
Sent: Friday, January 20, 2023 9:34 PM
To: r-help at r-project.org <r-help at r-project.org>; akshay_e4 at
hotmail.com <akshay_e4 at hotmail.com>; williamwdunlap at gmail.com
<williamwdunlap at gmail.com>
Subject: Re: function doesn't exists but still runs..... (akshay kulkarni)
It may help to expand a bit on Bill Dunlap's answer. I think that library
does something like this:
Create a new environment for all the package objects. This environment will not
be directly visible from .GlobalEnv, and ancestor environments may not be
directly visible either. It may contain functions & other objects that are
not exported, and it may use objects in ancestor environments that .GlobalEnv
doesn't see directly. On the other hand, functions in the package will still
see external functions in the way the package author intended instead of seeing
functions with the same name that are visible to .GlobalEnv.
Run the source code in the private environment (using source(local=private
environment, ....)?). Most package source code just defines functions, but the
source code could build other objects that the package needs for some reason, or
it could use delayedAssign to build the objects lazily. By default, the
environment of any function defined by the source code is the private
environment, so the function has access to private objects and to anything in
ancestor environments.
Create a second new environment whose parent is parent.env(.GlobalEnv). For
every export, assign the corresponding object from the private environment into
the corresponding name in the public environment. Note that the environment of
any function is still the private environment in which it was created. (I think
that a function is mostly determined by its environment, its formals, and its
body. A function call creates a new environment whose parent is the environment
of the function. Thus whoever wrote the function can control the search for
anything that isn?t passed in or created by the function itself.)
Reset parent.env(.GlobalEnv) to be the public environment. This makes all the
exported objects (usually functions) available at the command line and allows
the user to see everything that was available before (usually by name only, but
by scope-resolved name if necessary). As noted by Bill Dunlap and in more detail
above, package functions can use functions & other objects that are not
directly visible to the user. As he also showed, you can (usually) pierce the
privacy as long at least one function is exported. environment(package_function)
is the private environment, so you can use it to see all the private objects and
everything in the ancestor environments. You can repeat the trick to see private
environments of packages you didn't directly pull in. I think you can even
unlock bindings and do ghastly things to the package's private environment.
Regards,
Jorgen Harmse.
------------------------------
Message: 17
Date: Thu, 19 Jan 2023 16:02:31 -0800
From: Bill Dunlap <williamwdunlap at gmail.com>
To: akshay kulkarni <akshay_e4 at hotmail.com>
Cc: R help Mailing list <r-help at r-project.org>
Subject: Re: [R] function doesn't exists but still runs.....
Message-ID:
<CAHqSRuTCBqh84FHg7=Xmd9qHxUiAN3Y4zBJbkAR3dRWhggu89Q at
mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Look into R's scoping rules. E.g.,
urldefense.proofpoint.com/v2/url?u=https-3A__bookdown.org_rdpeng_rprogdatascience_scoping-2Drules-2Dof-2Dr.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=Mb3F4Yi_5e0mAkovoM8_Dai8vSPPDK3hbOWblRvh4Yo&e=.
* When a function looks up a name, it looks it up in the environment in
which the function was defined.
* Functions in a package are generally defined in the package's environment
(although sometimes they are in a descendent of the parent's environment).
* When one searches an environment for a name, if it is not found in the
environment the search continues in the parent environment of that
environment, recursively until the parent environment is the empty
environment.
> with(environment(wdman::selenium), java_check)
function ()
{
javapath <- Sys.which("java")
if (identical(unname(javapath), "")) {
stop("PATH to JAVA not found. Please check JAVA is
installed.")
}
javapath
}
<bytecode: 0x000001fd0ab826a8>
<environment: namespace:wdman>
-Bill
On Thu, Jan 19, 2023 at 2:28 PM akshay kulkarni <akshay_e4 at hotmail.com>
wrote:
> dear members,
> I am using the RSelenium package which uses
> the function selenium() from the wdman package. The selenium function
> contains the function java_check at line 12. If I try to run it, it throws
> an error:
>
> > javapath <- java_check()
> Error in java_check() : could not find function "java_check"
>
> Also:
>
> > exists("java_check")
> [1] FALSE
>
> But when I run selenium(), it works fine....
>
> How do you explain this conundrum? You can refer to this link:
>
urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ropensci_wdman_issues_15&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=XolZgwav8rnGPXeiF55H6PWDBFufTzdVohRiF_1uj7g&e>
> Specifically what concept of R explains this weird behaviour?
>
> Thanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&e>
PLEASE do read the posting guide
>
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&e>
and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]
------------------------------
Subject: Digest Footer
_______________________________________________
R-help at r-project.org mailing list
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&ePLEASE
do read the posting guide
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&eand
provide commented, minimal, self-contained, reproducible code.
------------------------------
End of R-help Digest, Vol 239, Issue 20
***************************************
[[alternative HTML version deleted]]
[[alternative HTML version deleted]]
------------------------------
Message: 3
Date: Mon, 23 Jan 2023 17:54:47 +0000
From: akshay kulkarni <akshay_e4 at hotmail.com>
To: Jorgen Harmse <JHarmse at roku.com>, "r-help at
r-project.org"
<r-help at r-project.org>
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni)
Message-ID:
<PU4P216MB15683A4FA52903D059493EB3C8C89 at
PU4P216MB1568.KORP216.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset="utf-8"
Dear Jorgen,
thanks a lot....
Thanking you,
Yours sincerely
Akshay M Kulkarni
________________________________
From: Jorgen Harmse <JHarmse at roku.com>
Sent: Monday, January 23, 2023 9:31 PM
To: r-help at r-project.org <r-help at r-project.org>; akshay kulkarni
<akshay_e4 at hotmail.com>
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still runs.....
(akshay kulkarni)
Hi Akshay,
I usually use debug (a function provided by R). When you are stepping through a
function your environment is the one in which function code is being executed,
so you can easily see everything that is visible to the function. If you single
step into a function that the first function calls then you also see everything
that is available to that function. Moreover, you don't see anything that is
not visible to the function you are debugging, so you can really determine what
any piece of code would do if called inside the function.
Note 1: Code in R is always executed in an environment. I show in the example
below that in the empty environment (the ultimate ancestor of all other
environments) R can't even add. Usually the current environment (e.g.
.GlobalEnv at the command line or a fresh environment created by a function
call) has the right contents and the right parent to do what you expect, but in
some special cases you need to understand how environments work. Even evalq
& with are functions (unavailable for example in the empty environment), and
the environment argument has to be evaluated in the current environment before
the main expression can be evaluated in the environment that you want.
> E[1]
[[1]]
<environment: R_EmptyEnv>
> evalq(2+2, E[[1L]])
Error in 2 + 2 : could not find function "+"
> evalq(2L+2L, E[[1L]])
Error in 2L + 2L : could not find function "+"
Note 2: Besides automatically showing what a function sees, using debug (instead
of hand-executing lines of code from the function) gives you the correct call
stack. Suppose that you run some code at the debug command line to make a
sub-sub-?-function do what you want, and you create in that environment what you
hope is the correct return value. You can then use parent.frame() to put that
value into the environment of the caller and run the caller's remaining code
in the correct environment to see what happens. If there are no other problems
then you can work your way up to top level and confirm that your patch has the
right effect before you even modify the actual code of the offending function.
(Saving all environments in .GlobalEnv forces R to keep them even if you quit
the debugger. Combining eval & parse is sometimes more convenient than using
evalq.)
Regards,
Jorgen.
------------------------------
Message: 2
Date: Sun, 22 Jan 2023 14:25:59 +0000
From: akshay kulkarni <akshay_e4 at hotmail.com>
To: Jorgen Harmse <JHarmse at roku.com>, "r-help at
r-project.org"
<r-help at r-project.org>, "williamwdunlap at gmail.com"
<williamwdunlap at gmail.com>
Subject: Re: [R] [EXTERNAL] Re: function doesn't exists but still
runs..... (akshay kulkarni)
Message-ID:
<PU4P216MB1568BDE0E4929806E096CC11C8CB9 at
PU4P216MB1568.KORP216.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset="utf-8"
Dear Jorgen,
regrets to reply this late....
I got into this issue because it threw an error, and it took more than 4 days to
fix this. I learnt a lot, and one things I learnt is to debug the function,
even when that is a public package function....instead of googling the error
message...Any ideas on how to do this more efficiently?
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jorgen Harmse <JHarmse at roku.com>
Sent: Friday, January 20, 2023 11:35 PM
To: akshay kulkarni <akshay_e4 at hotmail.com>; r-help at r-project.org
<r-help at r-project.org>; williamwdunlap at gmail.com <williamwdunlap
at gmail.com>
Subject: Re: [EXTERNAL] Re: function doesn't exists but still runs.....
(akshay kulkarni)
Hi Akshay,
Lexical scoping and environments are closely tied. (I think Bill even cited the
documentation.) I guess it's arcane in the sense that scoping usually does
what you expect, but the way that works is related to what we discussed.
What led you to discover the issue? Were you debugging the public package
function because it didn't do what you expected, or were you just curious
how it worked?
Regards,
Jorgen.
From: akshay kulkarni <akshay_e4 at hotmail.com>
Date: Friday, January 20, 2023 at 11:19
To: Jorgen Harmse <JHarmse at roku.com>, r-help at r-project.org
<r-help at r-project.org>, williamwdunlap at gmail.com <williamwdunlap
at gmail.com>
Subject: [EXTERNAL] Re: function doesn't exists but still runs..... (akshay
kulkarni)
Dear Jorgen,
thanks for the reply.....so according to you one can pegion
hole the problem as concerning R's lexical scoping rules,am I right? Or some
arcane concept regarding environments....?
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jorgen Harmse <JHarmse at roku.com>
Sent: Friday, January 20, 2023 9:34 PM
To: r-help at r-project.org <r-help at r-project.org>; akshay_e4 at
hotmail.com <akshay_e4 at hotmail.com>; williamwdunlap at gmail.com
<williamwdunlap at gmail.com>
Subject: Re: function doesn't exists but still runs..... (akshay kulkarni)
It may help to expand a bit on Bill Dunlap's answer. I think that library
does something like this:
Create a new environment for all the package objects. This environment will not
be directly visible from .GlobalEnv, and ancestor environments may not be
directly visible either. It may contain functions & other objects that are
not exported, and it may use objects in ancestor environments that .GlobalEnv
doesn't see directly. On the other hand, functions in the package will still
see external functions in the way the package author intended instead of seeing
functions with the same name that are visible to .GlobalEnv.
Run the source code in the private environment (using source(local=private
environment, ....)?). Most package source code just defines functions, but the
source code could build other objects that the package needs for some reason, or
it could use delayedAssign to build the objects lazily. By default, the
environment of any function defined by the source code is the private
environment, so the function has access to private objects and to anything in
ancestor environments.
Create a second new environment whose parent is parent.env(.GlobalEnv). For
every export, assign the corresponding object from the private environment into
the corresponding name in the public environment. Note that the environment of
any function is still the private environment in which it was created. (I think
that a function is mostly determined by its environment, its formals, and its
body. A function call creates a new environment whose parent is the environment
of the function. Thus whoever wrote the function can control the search for
anything that isn?t passed in or created by the function itself.)
Reset parent.env(.GlobalEnv) to be the public environment. This makes all the
exported objects (usually functions) available at the command line and allows
the user to see everything that was available before (usually by name only, but
by scope-resolved name if necessary). As noted by Bill Dunlap and in more detail
above, package functions can use functions & other objects that are not
directly visible to the user. As he also showed, you can (usually) pierce the
privacy as long at least one function is exported. environment(package_function)
is the private environment, so you can use it to see all the private objects and
everything in the ancestor environments. You can repeat the trick to see private
environments of packages you didn't directly pull in. I think you can even
unlock bindings and do ghastly things to the package's private environment.
Regards,
Jorgen Harmse.
------------------------------
Message: 17
Date: Thu, 19 Jan 2023 16:02:31 -0800
From: Bill Dunlap <williamwdunlap at gmail.com>
To: akshay kulkarni <akshay_e4 at hotmail.com>
Cc: R help Mailing list <r-help at r-project.org>
Subject: Re: [R] function doesn't exists but still runs.....
Message-ID:
<CAHqSRuTCBqh84FHg7=Xmd9qHxUiAN3Y4zBJbkAR3dRWhggu89Q at
mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Look into R's scoping rules. E.g.,
urldefense.proofpoint.com/v2/url?u=https-3A__bookdown.org_rdpeng_rprogdatascience_scoping-2Drules-2Dof-2Dr.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=Mb3F4Yi_5e0mAkovoM8_Dai8vSPPDK3hbOWblRvh4Yo&e=.
* When a function looks up a name, it looks it up in the environment in
which the function was defined.
* Functions in a package are generally defined in the package's environment
(although sometimes they are in a descendent of the parent's environment).
* When one searches an environment for a name, if it is not found in the
environment the search continues in the parent environment of that
environment, recursively until the parent environment is the empty
environment.
> with(environment(wdman::selenium), java_check)
function ()
{
javapath <- Sys.which("java")
if (identical(unname(javapath), "")) {
stop("PATH to JAVA not found. Please check JAVA is
installed.")
}
javapath
}
<bytecode: 0x000001fd0ab826a8>
<environment: namespace:wdman>
-Bill
On Thu, Jan 19, 2023 at 2:28 PM akshay kulkarni <akshay_e4 at hotmail.com>
wrote:
> dear members,
> I am using the RSelenium package which uses
> the function selenium() from the wdman package. The selenium function
> contains the function java_check at line 12. If I try to run it, it throws
> an error:
>
> > javapath <- java_check()
> Error in java_check() : could not find function "java_check"
>
> Also:
>
> > exists("java_check")
> [1] FALSE
>
> But when I run selenium(), it works fine....
>
> How do you explain this conundrum? You can refer to this link:
>
urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ropensci_wdman_issues_15&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=XolZgwav8rnGPXeiF55H6PWDBFufTzdVohRiF_1uj7g&e>
> Specifically what concept of R explains this weird behaviour?
>
> Thanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&e>
PLEASE do read the posting guide
>
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&e>
and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]
------------------------------
Subject: Digest Footer
_______________________________________________
R-help at r-project.org mailing list
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&ePLEASE
do read the posting guide
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&eand
provide commented, minimal, self-contained, reproducible code.
------------------------------
End of R-help Digest, Vol 239, Issue 20
***************************************
[[alternative HTML version deleted]]
[[alternative HTML version deleted]]
------------------------------
Message: 4
Date: Mon, 23 Jan 2023 18:38:23 +0000 (UTC)
From: varin sacha <varinsacha at yahoo.fr>
To: "r-help at r-project.org" <r-help at r-project.org>
Subject: [R] package FactoMineR
Message-ID: <830985149.1604446.1674499103618 at mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"
Dear R-experts,
Here below the R code working (page 8
urldefense.proofpoint.com/v2/url?u=http-3A__www2.uaem.mx_r-2Dmirror_web_packages_FactoMineR_FactoMineR.pdf&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=YSmLvNnRQ7MWmcgbyifplmgAMBL22w7f9xufQdUzwyQ&e=).
But I am trying to get all the labels (the writes) : comfort, university,
economic, world, ... smaller.
How could I do that ?
Many thanks.
library(FactoMineR)
data(children)
res.ca <- CA (children, row.sup = 15:18, col.sup = 6:8)
------------------------------
Message: 5
Date: Mon, 23 Jan 2023 19:16:42 +0000
From: Rui Barradas <ruipbarradas at sapo.pt>
To: varin sacha <varinsacha at yahoo.fr>, "r-help at
r-project.org"
<r-help at r-project.org>
Subject: Re: [R] package FactoMineR
Message-ID: <1fc08bf7-1a52-cabc-f8e9-4dabc158635c at sapo.pt>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
?s 18:38 de 23/01/2023, varin sacha via R-help escreveu:> Dear R-experts,
>
> Here below the R code working (page 8
urldefense.proofpoint.com/v2/url?u=http-3A__www2.uaem.mx_r-2Dmirror_web_packages_FactoMineR_FactoMineR.pdf&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=YSmLvNnRQ7MWmcgbyifplmgAMBL22w7f9xufQdUzwyQ&e=).
>
> But I am trying to get all the labels (the writes) : comfort, university,
economic, world, ... smaller.
> How could I do that ?
>
> Many thanks.
>
> library(FactoMineR)
> data(children)
> res.ca <- CA (children, row.sup = 15:18, col.sup = 6:8)
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&e>
PLEASE do read the posting guide
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&e>
and provide commented, minimal, self-contained, reproducible code.
Hello,
I'm not finding "smaller" but are you looking for
rownames(res.ca$row$coord)
rownames(res.ca$row.sup$coord)
?
Hope this helps,
Rui Barradas
------------------------------
Message: 6
Date: Tue, 24 Jan 2023 10:50:26 +0100
From: Martin Maechler <maechler at stat.math.ethz.ch>
To: Ziyun Tang <tziyun2 at gmail.com>
Cc: <r-help at r-project.org>
Subject: Re: [R] Flickering when scrolling in R graphics windows
Message-ID: <25551.43490.524282.598327 at stat.math.ethz.ch>
Content-Type: text/plain; charset="us-ascii"
>>>>> Ziyun Tang
>>>>> on Sat, 21 Jan 2023 15:14:15 -0500 writes:
> Hello, I have been experiencing some issues regarding scrolling with
> the mouse or trackpad in R graphics windows (from the base graphics
> package), which sometimes results in flickering, and wanted to see if
> anyone else had the same issues, or any advice. This happens for R
> version 4.2.2 on Windows 10 x64, and occurs when using Rgui and at the
> command line (whenever graphics windows are invoked). Note that some
> of the example code below can cause flickering and can be an issue for
> those with photosensitive epilepsy.
> Specifically, I have been experiencing three main issues, as follows:
> 1. When viewing a dataset with View(), the graphics window flickers
> when scrolling downwards too quickly, even with the option
> buffered=TRUE. For example:
>> View(iris)
If you use [Page Up] and [Page Down] there is no "flickering",
also using the cursor (up/down "arrows").
Still here, I would not think anything to be "wrong".
If you tell the computer to refresh a screen more quickly than
makes sense I guess you must expect what you see here.
(but yes, more modern GUIs would do 'smooth scrolling' here; I
think that's not available for the graphapp GUI in R for Windows)
By "scrolling", what exactly do you mean?
Is it that you use your mouse "wheel"? ... I assume "yes"
in
the following, because in that case I can partly reproduce what
you describe.
> 2. When viewing a graph with plot(), and scrolling down, the graphics
> window flickers between the background and the graph itself. For
> example:
>> plot(iris$Sepal.Length, iris$Sepal.Width)
At first I wrote
I don't understand how you can "scroll down" in this plot
but now that I've guessed you mean "mouse wheel scrolling" I can
indeed see what you describe.
> 3. When viewing a matrix of scatterplots with pairs(), and scrolling
> down, the graphics window flickers between the background and the
> individual scatterplots. In some instances, when scrolling down with
> the trackpad, the window flickers continuously, and subsequently
> closing the window crashes R. For example:
>> pairs(iris[1:4])
That you bring R to crash just by "scrolling" really seems a bad
thing and points to a bug.
OTOH, I have not been able to replicate a crash.
I don't know what mouse-wheel-scrolling should do in a graphics window
in R for Windows.
In our terminal server version of Windows,
using Rterm (via ESS = Emacs Speaks Statistics), I can indeed
see that mouse-scrolling in a graphics window has *very funny*
/ strange effects when using the default interactive graphics
device ( .Device == "windows" ) :
Notably, after say pairs(iris) mouse-wheel-scrolling
"kind of" redraws some of the panel plots mostly in full size
(instead of the size they were as panels and as part of the full
"pairs" i.e., scatter plot matrix.
If instead I use RStudio and their own device "RD<something>"
mouse-wheel-scrolling has no effect, e.g., after pairs(iris).
And "no effect" is clearly better than what we observe with the R
default device "windows" i.e., windows() in the above situation.
> My sessionInfo() is as follows:
> R version 4.2.2 (2022-10-31 ucrt)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 19044)
> Matrix products: default
> locale:
> [1] LC_COLLATE=English_United States.utf8
> [2] LC_CTYPE=English_United States.utf8
> [3] LC_MONETARY=English_United States.utf8
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.utf8
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
> loaded via a namespace (and not attached):
> [1] compiler_4.2.2 tools_4.2.2
> Thank you in advance,
> Ziyun
------------------------------
Message: 7
Date: Tue, 24 Jan 2023 10:09:52 +0000
From: PIKAL Petr <petr.pikal at precheza.cz>
To: varin sacha <varinsacha at yahoo.fr>, "r-help at
r-project.org"
<r-help at r-project.org>
Subject: Re: [R] package FactoMineR
Message-ID:
<8e2fa4fe9f284e08b236e9b9f1dbd94a at SRVEXCHCM1302.precheza.cz>
Content-Type: text/plain; charset="utf-8"
Hallo Sacha
AFAIK the functions in FactoMineR do not enable to manipulate label size. Plot
is performed by this part:
if (graph & (ncp > 1)) {
print(plot(res, axes = axes))
if (!is.null(quanti.sup))
print(plot(res, choix = "quanti.sup", axes = axes,
new.plot = TRUE))
and the function is not designed to accept additional parameters to manipulate
size of labels.
I struggled with it few years ago and I decided to use biplot instead as it
enables more options.
You can contact maintainers if they consider an improvement in future
versions. Probably simple ... in function definition and print(plot(res, axes
= axes, ...)) addition could do the trick, but I am not sure.
Cheers
Petr
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of varin
sacha via R-
> help
> Sent: Monday, January 23, 2023 7:38 PM
> To: r-help at r-project.org
> Subject: [R] package FactoMineR
>
> Dear R-experts,
>
> Here below the R code working (page 8
urldefense.proofpoint.com/v2/url?u=http-3A__www2.uaem.mx_r-2D&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=xKACgL9iNPXeIvE0V5ckPFY1PuPDY-l0gT_UjZwmkr4&e>
mirror/web/packages/FactoMineR/FactoMineR.pdf).
>
> But I am trying to get all the labels (the writes) : comfort, university,
> economic,
> world, ... smaller. How could I do that ?
>
> Many thanks.
>
> library(FactoMineR)
> data(children)
> res.ca <- CA (children, row.sup = 15:18, col.sup = 6:8)
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&e>
PLEASE do read the posting guide
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&e>
and provide commented, minimal, self-contained, reproducible code.
------------------------------
Subject: Digest Footer
_______________________________________________
R-help at r-project.org mailing list
urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=WyAtmOvZqkJ83zE98hkQxz9o1I6k6gYj7KJzInNKmcQ&ePLEASE
do read the posting guide
urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIGaQ&c=27AKQ-AFTMvLXtgZ7shZqsfSXu-Fwzpqk4BoASshREk&r=ug-gw1ia3rShGleyKIdg4GIXRt6aKD3u1CM4odHlsvE&m=FCARkfGgHXcSaTZN1f38_6XCbtZ-Lopl641M4MpApMJf7EuJ7y2Y4873aWz38wiY&s=LvYxgn0N8iyJd6E3RK9ecZ0STO1_BIgO6gtE_zSJv-g&eand
provide commented, minimal, self-contained, reproducible code.
------------------------------
End of R-help Digest, Vol 239, Issue 24
***************************************
----------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments, is for
the sole use of the intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message.
[[alternative HTML version deleted]]