similar to: indexing lists, using brobdingnagian

Displaying 20 results from an estimated 600 matches similar to: "indexing lists, using brobdingnagian"

2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et seq pro tem. Next problem: how to define "Summary" methods for brobs. ?max says 'max' and 'min' are generic functions: methods can be defined for them individually or via the 'Summary' group generic. For this to work properly, the arguments '...' should be
2006 Sep 15
1
setMethod() woes
Hello everybody R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7 Next S4 problem. I have "brob" objects that are large real numbers, and now I want "glub" numbers that are to be a pair of glubs that represent complex numbers. I want to define binary operator "+" so that if either the left or right argument are glubs, it uses .ArithGlub. If either
2007 Aug 30
7
Behaviour of very large numbers
Dear all, I am struggling to understand this. What happens when you raise a negative value to a power and the result is a very large number? B [1] 47.73092 > -51^B [1] -3.190824e+81 # seems fine # now this: > x <- seq(-51,-49,length=100) > x^B [1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN <snip> > is.numeric(x^B) [1] TRUE > is.real(x^B) [1]
2006 Aug 30
1
setMethod() and log()
Hi I am having difficulty with setMethod(). I have a "brob" class of objects whose representation has two slots: "x" and "positive". Slot "x" (double) holds the log of a number and slot "positive" (logical) its sign. The idea is that large numbers can be handled. I'm trying to implement a log() method using an analogue of the
2006 Oct 31
1
setReplaceMethod
Hi If x <- 1:10 then x[5] <- 1i will promote x to be a complex vector. Suppose I have an S4 class "brob", and have functions is.brob(), as.brob(), as.numeric() and so forth (minimal self-contained code below). If x is numeric (1:10, say) and y is a brob, what is the best way to make x[5] <- y promote x to a brob in the same way as the complex example? Or is
2006 Sep 01
1
setMethod("Logic", ...)
Hi In V&R the "polynomial" class is explicitly specified to have no logical operators: setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop ("...")}) I too have a class of objects for which I want to specify that Logic operators do not work, but executing setClass("brob", representation = representation
2010 Oct 08
2
Error message in as.brob Usage
I am getting the following error message while using the as.brob function in some computations: Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] - : NAs are not allowed in subscripted assignments Is there any obvious mistake I am making here that can resolve the above error message? Thanks for your help. Chow -- View this message in context:
2007 Nov 21
1
equivalent of Matlab robustfit?
Hi, I've been using the Matlab robustfit function for linear regressions where I suspect some data points are outliers. Is there an equivalent function in R? Take care, Darren PS, This is the Matlab help on robustfit: >> help robustfit ROBUSTFIT Robust linear regression B = ROBUSTFIT(X,Y) returns the vector B of regression coefficients, obtained by performing robust
2006 Sep 12
1
package.skeleton() in R-2.4.1
Hi R version 2.4.0 alpha (2006-09-06 r39158) MacOSX 10.4.7 There was a thread some time ago as to whether the structure created by package.skeleton() would pass R CMD check. I have an example where package.skeleton() gives an R file that gives an error when sourced. If I type setClass("brob", representation = representation
2008 Sep 16
0
FW: odesolve dynload example
HI R Gurus, > This is my first foray into using c-code with R, so ... > I had a look at the archives and did not find anything on this, so > hopefully I am not doubling up. > I have previously used the following approach where I needed some very small numbers/large (using Brobdingnag): surfacewithdiff <- function(t, y, p) { const=p["const"] kay
2008 Sep 16
0
lsoda( linking to GMP for big numbers from C code)
Hi R used with C-code experts, I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have previously used the following approach where I needed some very small/large numbers (using Brobdingnag): surfacewithdiff <- function(t, y, p) { const=p["const"] kay =p["kay"] psii=p["psii"]
2011 Jul 25
1
Problem with random number simulation
Hi this is my first post. I am trying to run a simulation for a computer playing Von Neumann poker and adjusting it's expectation of an opponent's behavior according to how the opponent plays. This program involves random generation of "hands" and shifting of parameters. However, when I run the code, no errors come up, but the program doesn't do anything. Could someone
2007 Jan 12
0
Dummy's guide to S4 methods: package Brobdingnag
Hello List. please find uploaded to CRAN a new package, Brobdingnag. This package does two things: (1) allows computation of very large numbers using a logarithmic representation. (2) provides a "Hello, World" example of S4 methods in use: there are two classes of object (brob and glub) and one virtual class (swift). The package includes a vignette that is a
2000 Jan 10
1
'at' parameter in mtext(.., adj=0, outer=T) (PR#396)
Depending on the setting of par()$usr, the 'at' setting in mtext(.., adj=0, outer=T) may cause the text to appear in an anomalous position (e. g. in the first instance below, at the left of the plot region rather than at 'at=0' in the figure region), or the text may not appear at all. If one does not set the 'at' parameter the text appears (with 'adj=0') on the
2013 Mar 22
1
Trouble embedding functions (e.g., deltaMethod) in other functions
Dear R community, I've been writing simple functions for the past year and half and have come across a similar problem several times. The execution of a function within my own function produces NaN's or fails to execute as intended. My conundrum is that I can execute the function outside of my function without error, so it's difficult for me, as a novice functioneer, to figure out
2009 Jun 09
3
rpart - the xval argument in rpart.control and in xpred.rpart
Dear R users, I'm working with the rpart package and want to evaluate the performance of user defined split functions. I have some problems in understanding the meaning of the xval argument in the two functions rpart.control and xpred.rpart. In the former it is defined as the number of cross-validations while in the latter it is defined as the number of cross-validation groups. If I am
2010 Mar 12
1
using xval in mvpart to specify cross validation groups
Dear R's I'm trying to use specific rather than random cross-validation groups in mvpart. The man page says: xval Number of cross-validations or vector defining cross-validation groups. And I found this reply to the list by Terry Therneau from 2006 The rpart function allows one to give the cross-validation groups explicitly. So if the number of observations was 10, you could use
2009 Feb 11
5
How to handle large numbers?
Dear R, I have two questions: 1, Why both R and Matlab give 0*Inf==NaN? To my knowledge, it should be zero mathematically. Am I right? 2, I need to calculate e.g. exp(a)/(exp(b)+c), where both a and b are very large numbers (>>1000, e.g a=1000, b=1007, and c=5). R gives me NaN when I use the following command: > exp(1000)/(exp(1007)+5) [1] NaN I am pretty sure this should be close to
2009 Sep 24
3
pipe data from plot(). was: ROCR.plot methods, cross validation averaging
All, I'm trying again with a slightly more generic version of my first question. I can extract the plotted values from hist(), boxplot(), and even plot.randomForest(). Observe: # get some data dat <- rnorm(100) # grab histogram data hdat <- hist(dat) hdat #provides details of the hist output #grab boxplot data bdat <- boxplot(dat) bdat #provides details of the boxplot
2007 Mar 01
1
Generating R plots through Perl
Hello, I am in the process of writing a Perl program to carry out and analyze large numbers of regressions using R as the regression engine, and I am using Statistics::R to create the communication bridge between the two programs. Statistics::R creates a pipe between R and Perl and uses Rterm.exe (hidden during run-time) to carry out the R commands. This communication bridge works well for