Displaying 20 results from an estimated 6000 matches similar to: ""locked environment""
2003 Jul 09
2
Packages, generics, S3 and S4
My question has two parts.
The first is with regard to the frame or environment in which generic
functions are defined in packages. It seems as though they are defined
(i.e. exist as objects) in frame 1, even when defined in a package.
The following is a short example:
setClass("track",representation(x="numeric",y="numeric"))
plotTrack <- function(x,y,...)
2003 Jun 06
3
irregular time-series
I make quite a lot of use of irregular time-series, and had already spent a
bit of time writing an 'its' class when the 'irts' class was released via
the package 'tseries'.
I have experimented with the 'irts' class, and have some practical issues
with its use. In some applications of irregular time-series (in my case
these are financial and econometric) there are
2001 Nov 28
1
Assignment to a list in a function
Assignment to a list in a function does not behave as I would expect.
The following function illustrates the point
#----------------------------------------
temp _ function()
{
nf _ 2
ns _ 5
z _ vector("list",ns)
x _ matrix(NA,nrow=ns,ncol=nf)
for(j in 1:ns)
{
for(i in 1:nf)
{
x[,i] _ i+j*100
}
z[[j]] _ x
print(z[[j]])
}
z
}
2004 Jan 08
3
S3, S4, namespace
I have encountered an issue which I have been unable to resolve, involving
an S3 generic (print) being declared S4 generic in a package, and the method
being exported. This all works fine - the problem occurs when I try to
import the method to another package.
Here is the bit that works fine. -------------
#the .r file for package bar
2004 Feb 26
2
package 'stats' needs import directive for 1.9.0?
I maintain the Irregular Time Series (its) package on CRAN. I am currently
testing a release. Under 1.8.1 I am able to define a S4 generic 'start' as
follows:
if(!isGeneric("start")) {setGeneric("start", useAsDefault=start)}
Under 1.9.0, Rcmd check generates an error, as 'start' is not recognised.
If I use the NAMESPACE directive IMPORT, all is well:
2004 Mar 03
1
match.call(), S4
I get different results from match.call(), according to whether a function
is dispatched via S3 or S4. Specifically, when I use S4 dispatch in the
following example, the match.call() result is of length 1 less than I
expect. I need to add an extra comma to get the same results as in the S3
method.
--------example
setClass("foo",representation("matrix"))
2003 Aug 11
1
New package: irregular time-series (its)
I have uploaded to CRAN a new package named 'its' (Irregular Time-Series).
It
implements irregular time-series as an S4 class, extending the matrix class,
and records the time-stamp of each row in the matrix using POSIX. Print,
plot,
extraction, append, and related functionality are available.
Feedback and suggestions are welcome.
Giles Heywood
2003 Aug 11
1
New package: irregular time-series (its)
I have uploaded to CRAN a new package named 'its' (Irregular Time-Series).
It
implements irregular time-series as an S4 class, extending the matrix class,
and records the time-stamp of each row in the matrix using POSIX. Print,
plot,
extraction, append, and related functionality are available.
Feedback and suggestions are welcome.
Giles Heywood
2002 May 28
1
constrained regression
I want to do a linear regression where the coefficients
obey two linear constraints, and also are all non-negative.
What is the best way to do this? Computational speed is a
consideration as I must do it many times.
When this question was asked previously on the list, quadprog
was suggested - is this the best solution?
(I may have missed something obvious in the documentation,
but I have
2004 Oct 25
1
copyright issues when package maintainer changes
I will be taking over as maintainer of the its package from Giles Heywood.
The code was originally written while he was working at Commerzbank. I have
added the header below to the top of the R source file to indicate the
changes in the copyrights for the code. The package was originally released
under GPL2. I have no experience with copyright issues, and would
appreciate it if someone who does
2003 Nov 04
2
Object saved from 1.7.1, loaded in 1.8.0
I am having difficulty using in 1.8.0 an object created under 1.7.1. The
following is a 'minimal example' of the issue. First the part in 1.7.1:
> require("methods")
[1] TRUE
> setClass("foo",representation("vector",label="character"))
[1] "foo"
> x <- new("foo",1:2,label=LETTERS[1:2])
>
2017 Apr 19
2
Crash after (wrongly) applying product operator on S4 object that derives from list
Dear Hilmar
Perhaps this gives an indication of why the infinite recursion happens:
## after calling `*` on ma and a matrix:
> showMethods(classes=class(ma), includeDefs=TRUE, inherited = TRUE)
Function: * (package base)
e1="FOOCLASS", e2="matrix"
(inherited from: e1="vector", e2="structure")
(definition from function "Ops")
2019 Sep 11
2
'==' operator: inconsistency in data.frame(...) == NULL
Sorry, I can't reproduce the example below even on the same machine.
However, the following example produces the same error as NULL values in
prior examples:
> setClass("FOOCLASS",
+????????? representation("list")
+ )
> ma = new("FOOCLASS", list(M=matrix(rnorm(300), 30,10)))
> isS4(ma)
[1] TRUE
> data.frame(a=1:3) == ma
Error in
2003 Jun 10
1
c(...) and methods
I have been writing some S4 classes and have a problem about how I might
pass a signature to "c()".
Take the following example:
setClass("collection", representation("list", date="POSIXt"))
x <- new("collection", list(1,2,3), date=Sys.time())
y <- new("collection", list(4,5,6), date=Sys.time())
obviously, I can do c(x,y), but
2003 May 19
3
how to run R as a daemon
Hi all,
Using R a as a real-time application called by Php for a website, I
would like to run one R process only, which would manage user
connections. For the time each user who asks for an analysis causes a
new R process to start, which is not suitable in prevision of many
users. R needs about 30 seconds to run the script which makes the
analysis. The problem is that this waiting time is n
2007 Jul 21
1
Testing shorthand array push <<
Hi everyone,
I''m trying to test the shorthand way to push objects into an array. My
controller looks like:
current_user.foos << @foo
and I keep getting an error like Mock ''foos'' received unexpected message :<<
with <FooClass>
does anyone have a good solution for this?
I tried controller.send(:current_user).labels.stub!(:<<).and_return([]) and
2002 Oct 17
0
RE: R2HTML package for R 1.6
Does this help on our backtest reporting?
Regards,
Gordon Morrison
Global Head of Quantitative Research
> * + 44 20 7653 7642
> Mob: + 44 7867 801951
> fax: + 44 20 7645 7442
> * mailto:gordon.morrison at commerzbankib.com
> web: http://www.cbksec.com/research/quant
> * Commerzbank Securities
> 60 Gracechurch Street
> London EC3V 0HR, U.K.
>
2017 Apr 24
2
Crash after (wrongly) applying product operator on object from LIMMA package
Hi Hilmar,
weird. The memory problem seems be due to recursion (my R, version 3.3.3,
says: Error: evaluation nested too deeply: infinite recursion /
options(expressions=)?, just write traceback() to see how it happens), but
why does it segfault with xlsx? Nb xlsx is the culprit: neither rJava nor
xlsxjars cause the problem.
On the other hand, quick googling for r+xlsx+segfault returns tons of
2009 Nov 17
4
''lowest common denominator'' cpuid feature set
I want to be able to test live migration... I have an intel box and an
amd box, so live migration between them won''t ''just work''. From what
I''ve read though, I should be able to use cpuid to turn off all the cpu
features which might be different between them. Is this do-able? I''m
willing to accept any resulting loss of performance etc.
James
2007 Aug 17
6
Gutsy Xen 3.1 2.6.22-9-xen network-bridge problem
Hi,
I have a strange problem with my networking setup. I read all forums around
the world where people had similar problems, but couldn''t find a solution.
I have an Attansic L1 gigeth chip on my mainboard. This chip works OK in
stock Ubuntu Gutsy (development) 2.6.22-9-generic kernel.
When I boot into Xen, and after the bridge is created, the network stops
working. Some info:
- If I