Displaying 15 results from an estimated 15 matches for "environmentnam".
Did you mean:
environmentname
2007 Jan 07
2
environmentName
I noticed the new environmentName in R 2.5.0dev. Thus I gather that
each environment has:
(1) a name
(2) a hex value
so
1. environmentName gets the name. Is there any way to set the name?
2. is there any way to get the hex value for an environment other than doing:
e <- new.env()
capture.output(e)
2010 Jul 14
1
Set environment name
Hello All,
?environmentName shows how to get the environment name. But I don't
see how to set the name in the first place. Could you tell me where to
look for the function that set the environment name?
--
Tom
2016 Dec 08
2
methods(`|`) lists all functions?
...list of functions (or variables)
in a "normal" way? I used 'ls("package:base")' for the exercise,
because I saw this call used somewhere as an example, but I couldn't
find that "package:" syntax documented under ls()... Also found this
confusing:
> environmentName(globalenv())
[1] "R_GlobalEnv"
> ls("R_GlobalEnv")
Error in as.environment(pos) :
no item called "R_GlobalEnv" on the search list
So I'm not sure if "package:base" is naming an environment, or if
there are different ways to name env...
2016 Dec 09
0
methods(`|`) lists all functions?
...les)
> in a "normal" way? I used 'ls("package:base")' for the exercise,
> because I saw this call used somewhere as an example, but I couldn't
> find that "package:" syntax documented under ls()... Also found this
> confusing:
>
> > environmentName(globalenv())
> [1] "R_GlobalEnv"
> > ls("R_GlobalEnv")
> Error in as.environment(pos) :
> no item called "R_GlobalEnv" on the search list
>
> So I'm not sure if "package:base" is naming an environment, or if
> th...
2010 Aug 23
5
How to remove all objects except a few specified objects?
How to remove all R objects in the RAM except for a few specified ones?
rm(list=ls()) removes all R objects in the R work space.
Another question is that whether removing all R objects actually releases
the RAM? Thanks.
--
View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2335651.html
Sent from the R help mailing list
2015 Jul 07
3
List S3 methods and defining packages
Hi,
from the man page ?methods, I expected to be able to build pairs
(class,package) for a given S3 method, e.g., print, using
attr(methods(print), 'info').
However all the methods, except the ones defined in base or S4
methods, get the 'from' value "registered S3method for print", instead
of the actual package name (see below for the first rows).
Is this normal
2016 Apr 13
0
formula argument evaluation
...|| nchar(string) > maxlen)
paste(substring(string[1], 1, maxlen), "...", sep = "")
else string
}
myDeparse <- function(object) {
if (!is.environment(object)) {
deparse(object)
}
else {
ename <- environmentName(object)
if (ename == "")
ename <- "<unnamed env>"
paste(sep = "", "<", ename, "> ", paste(collapse = " ",
objects(object)))
}
}
cat(rep(" ",...
2016 Apr 13
2
formula argument evaluation
I suppose it would work, although "=>" is rather a descriptive symbol and
less a function.
But choosing between quoting:
"A + B => C"
and a regular function:
A + B %=>% C
probably quoting is the most straightforward, as the result of the foo()
function has to be a string anyways (which is parsed by other functions).
On Tue, Apr 12, 2016 at 6:20 PM, Richard M.
2015 Jul 07
0
List S3 methods and defining packages
...your use case, maybe something like
.S3methodsInNamespace <- function(envir, pattern) {
mtable <- get(".__S3MethodsTable__.", envir = asNamespace(envir))
methods <- ls(mtable, pattern = pattern)
env <- vapply(methods, function(x) {
environmentName(environment(get(x, mtable)))
}, character(1))
setNames(names(env), unname(env))
}
followed by
nmspc = loadedNamespaces()
lapply(setNames(nmspc, nmspc), .S3methodsInNamespace, "^plot.")
which reveals the different meanings of 'from', e.g.,
> l...
2015 Jul 08
0
List S3 methods and defining packages
...hodsInNamespace <- function(envir, pattern) {
>>> mtable <- get(".__S3MethodsTable__.", envir = asNamespace(envir))
>>> methods <- ls(mtable, pattern = pattern)
>>> env <- vapply(methods, function(x) {
>>> environmentName(environment(get(x, mtable)))
>>> }, character(1))
>>> setNames(names(env), unname(env))
>>> }
>>>
>>>
>>> followed by
>>>
>>> nmspc = loadedNamespaces()
>>> lapply(setNames(nmspc, nmspc), .S3me...
2011 Jan 14
1
Help on a Display function
>
I wanted to simulate the Matlab DISPLAY function for some time now.
After seeing a recent proposal by Gabor Grothendieck I came up with the
following solution,
display <- function(...) {
my_names <- lapply(substitute(placeholderFunction(...))[-1], deparse)
for (my in my_names) cat(my, "=", eval(parse(text=my)), "\n", sep=" ")
}
that works about as
2007 Oct 03
1
R-2.6.0 is released
...r the
default methods, but names would be matched for S3 and S4
methods and in the case of '!' the argument name differed
between S3 and S4 methods.)
o Imports environments of name spaces are named (as
"imports:foo"), and so are known e.g. to environmentName().
o Package 'stats4' uses lazy-loading not SaveImage (which is now
deprecated).
o Installing help for a package now parses the .Rd file only
once, rather than once for each type.
o PCRE has been updated to version 7.2.
o bzip2 has been updated t...
2007 Oct 03
1
R-2.6.0 is released
...r the
default methods, but names would be matched for S3 and S4
methods and in the case of '!' the argument name differed
between S3 and S4 methods.)
o Imports environments of name spaces are named (as
"imports:foo"), and so are known e.g. to environmentName().
o Package 'stats4' uses lazy-loading not SaveImage (which is now
deprecated).
o Installing help for a package now parses the .Rd file only
once, rather than once for each type.
o PCRE has been updated to version 7.2.
o bzip2 has been updated t...
2007 Apr 24
0
R 2.5.0 is released
...function, which also has a replacement form, and there are
conversion methods to and from numeric, which also allow the
specification of units. Objects of this class can also be
stored in data frames now. A format() method has been added,
and the print method was revised.
o New function environmentName() to give the print name of
environments such as "namespace:base".
This is now used by str().
o New function env.profile() provides R level access to summary
statistics on environments. In a related patch, new.env()
now allows the user to specify an initial size for a hashed
e...
2007 Apr 24
0
R 2.5.0 is released
...function, which also has a replacement form, and there are
conversion methods to and from numeric, which also allow the
specification of units. Objects of this class can also be
stored in data frames now. A format() method has been added,
and the print method was revised.
o New function environmentName() to give the print name of
environments such as "namespace:base".
This is now used by str().
o New function env.profile() provides R level access to summary
statistics on environments. In a related patch, new.env()
now allows the user to specify an initial size for a hashed
e...