Displaying 20 results from an estimated 1000 matches similar to: "environments"
2011 Mar 17
1
assigning to list element within target environment
I would like to assign an value to an element of a list contained in an
environment. The list will contain vectors and matrices. Here's a simple
example:
# create toy environment
testEnv = new.env(parent = emptyenv())
# create list that will be in the environment, then assign() it
x = list(a=1,b=2)
assign("xList",x,testEnv)
# create new element, to be inserted into xList
c = 5:7
2006 Nov 26
1
Patch for optiups to support Zinto D from ONLINE USV-Systeme AG
Hi Arnaud,
Hi Scott,
Hi list,
Here is a patch to support the Zinto D from ONLINE USV-Systeme AG.
I already sent a version to Russell Kroll (2006-04-09), without no response
and I cannot find support for Zinto in svn until now.
I found a discussion on this list about the Xanto from ONLINE, but the Zinto
seems to use different commands.
The commands are quite similar to those for Opti-UPS, so I
2006 Sep 09
5
"locals" in render partial
Hi all,
I''m getting an error and I really don''t know why, because I seem to be
doing everything well..I pass "testvar" as a variable to render partial:
<%= render(:partial => "main/categorysmallitem", :collection =>
group_of_four, :locals => {:testvar=>"AA"})%>
But then, when I try to use testvar inside the partial, it
2004 Feb 08
3
Re: klibc - setenv broken
Kay Sievers wrote:
> Hi,
> this simple program compiled with klibc:
>
> #include <stdio.h>
> int main(int argc, char* argv[])
> {
> setenv("TESTENV", "happy", 1);
> printf("TESTENV='%s'\n", getenv("TESTENV"));
> }
>
> prints:
>
> ./env
> TESTENV='(null)'
>
>
2006 May 17
4
Variable Inheritance - Set in Child, Read by Parent
Here's what I'm doing:
1. I set __FOO=0 in the current context.
2. I use Dial() and the M(testvar) macro call.
3. The macro-testvar can see ${FOO} just fine.
4. the macro-testvar modifies FOO. I tried:
Set(__FOO=1)
Set(_FOO=1)
Set(FOO=1)
5. When the Dial()ed call hangs up, and the original context continues,
FOO is still 0.
2007 Nov 21
2
I''m lost on exec
Hi
Can anyone tell me what''s wrong with this one.
Sorry I''m new and I just want to print some message to the the puppet
log on the client side.
---------------------------------------------------
$testvar = "Hello world!"
class mytest {
exec { "/bin/echo $testvar" }
}
I keep getting:
err: Could not parse; using old configuration: Syntax error at
2011 Feb 11
2
fitdistr question
Hello,
I tried to fit a poisson distribution but looking at the function
fitdistr() it does not optimize lambda but simply estimates the mean
of the data and returns it as lambda. I'm a bit confused because I was
expecting an optimization of this parameter to gain a good fit...
If I would use mle() of stats4 package or mle2() of bbmle package, I
would have to write the function by myself
2006 Jan 31
4
Sos! "Lines" doesn't add plots to an existing plot...
I am lost:
> plot(testError, col="red")
> lines(testVar, col="black")
Only one plot (the red one) appear on the Window, the black line did not
appear...what's wrong?
Thanks a lot!
[[alternative HTML version deleted]]
2020 May 12
4
S3 method dispatch for methods in local environments
Dear All,
In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example:
myfun <- function(y) {
out <- list(y=y)
class(out) <- "myclass"
return(out)
}
print.myclass <- function(x, ...) print(formatC(x$y, format="f", digits=5))
myfun(1:4)
# prints: [1]
2011 Feb 21
2
Console output
Hi there,
I though there has been a possibility to force the output on the
console with one element per line. Instead of this:
> 1:10
[1] 1 2 3 4 5 6 7 8 9 10
something like this
> 1:10
[1] 1
[2] 2
[3] 3
[4] 4
[5] 5
[6] 6
[7] 7
[8] 8
[9] 9
[10] 10
Can anybody help?
Antje
2004 Jul 22
3
[fdo] Scheduling subsystems (crontab, at) and the desktop
Hi there fellow hackers, geeks and others who want the UNIX desktop to
succeed.
I bring forward the question whether or not a (freedesktop.org)
specification is necessary for application scheduling software.
The current UNIX Desktop user does not have an easy way to configure the
tasks which he wants to schedule. Sure we have such a utility. And sure
we can shout to our Desktop users
2008 Dec 05
6
levels update
Hello,
I hope this question is not too stupid. I would like to know how to update
levels after subsetting data from a data.frame.
df <- data.frame(factor(c("a","a","c","b","b")), c(4,5,6,7,8), c(9,1,2,3,4))
names(df) <- c("X1","X2","X3")
my.sub <- subset(df, X1 == "a" | X1 == "b")
2006 Nov 01
4
extract values from a vector
Hello,
I'm looking for a solution for the following problem:
I have two vectors
V1 <- c("apple","honey","milk","bread","butter")
V2 <- c("bread","milk")
now, I would like to know for each element in V1 if it's equal to one of
the elements in V2
I could do:
which(V1 == V2[1] | V1 == V2[2])
but what if I
2008 Aug 22
1
nesting environments
Hello,
I got the hint to use nesting environments (for a GUI problem), but I'm not
sure whether I understand what he means (and I did not really succeed with
reading documentation - probably I looked for the wrong keywords?).
That's what he wrote:
> Another good way to control the scoping is nesting environments (e.g.
through closures). That is, your object does not need to be
2010 Sep 03
3
S4 Method Signatures
Hello,
If the signature of a method defines which generic it implements then I'm confused about why this minimal example I invented won't work :
setGeneric("myFun", function(rs, ...){standardGeneric("myFun")})
setGeneric("myFun", function(cs, ...){standardGeneric("myFun")})
setMethod("myFun", "numeric", function(rs, colour =
2006 Feb 02
2
How to get the namespace of a function?
I declared the environment of the function myfun to be NULL as follows:
environment(myfun) <- NULL
Later on I called that myfun and got an error message because the
function index() in the zoo package was called inside myfun and was
not visible:
Error in myfun(args) : couldn't find function "index"
I tried to use zoo::index() instead of index(), but that did not work.
In fact,
2011 Feb 02
1
pass nrow(x) to dots in function(x){plot(x,...)}
Dear Rers,
I have a function to barplot() a matrix, eg
myfun <- function(x, ...) { barplot(x , ... )}
(The real function is more complicated, it does things to the matrix first.)
So I can do:
m1 <- matrix(1:20,4)
myfun(m1)
myfun(m1, main="My title")
I'd like to be able to add the number of rows of the matrix passed to
the function to the "..." argument, eg
2009 Jun 12
1
how to trigger variable creation?
Hello R users,
i'm wondering how to trigger variable creation.
Whenever a variable is created i want my own function myFun(...) to be
started.
if (exists("x")) {rm(x)} # after removal of x
# any of these calls
x<-10 # should call myFun
x=10 # should call myFun
assign(x,10) # should call myFun
etc.
2008 Dec 02
3
boxplot via plot command
Hi folks,
I've just discovered that the following code leads to boxplot (surprisingly to me).
Can anybody explain to me why? Is this documented somewhere? I've never
consider this option before.
x <- rnorm(300)
l <- c(rep("label1",100), rep("label2",50), rep("label3",150))
df <- data.frame(as.factor(l), x)
plot(df)
Thank you!
Antje
2006 Aug 23
5
two density curves in one plot?
Hello,
I was wondering if I can plot two curves I get from "density(data)" into
one plot. I want to compare both.
With the following commad, I just get one curve plotted:
plot( density(mydata) )
Sorry for this stupid question but I could not find a solution until now...
Antje