similar to: dput() error

Displaying 20 results from an estimated 10000 matches similar to: "dput() error"

2005 Jan 07
1
Visualizing complex analytic functions using domain coloring
Hi has anyone coded up domain colouring for visualizing complex analytic functions (such as elliptic functions)? [ the idea is to depict a complex function f(z) using a filled.contour() variant in which the hue is given by Arg(f(z)), and the saturation by Mod(f(z)). ] -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel
2006 Aug 29
2
vector S4 classes
In the Green Book, section 7.5 discusses new vector classes and uses quaternions as an example of a vector class that needs more than one number per element. I would like to define a new class that has a numeric vector and a logical vector of the same length that specifies whether the measurement was accurate. The following code does not behave as desired: >
2006 Apr 27
2
summary(lm(x~y)) difference between R-2.2.1 and R-2.3.0
Hi [macOSX 10.4.6; R-2.3.0] I have encountered a difference in behaviour between R-2.2.1 and R-2.3.0 when performing a linear model. Transcript follows for R-2.3.0 (R-2.2.1 worked as expected). How to make R-2.3.0 perform as R-2.2.1 did? > dput(x) c(29.13, 29.88, 30.09, 29.99, 29.74, 29.64, 29.65, 29.7, 30.04, 29.89, 29.96, 29.65, 28.76, 28.41, 28.38, 29.55, 29.76, 29.75, 29.84,
2006 Jul 26
2
largest acceptable lookup table in a package
Hi One of my packages needs a look-up table of pre-calculated numbers in the data directory. I would like to have the matrix as large as possible. What is the largest size matrix that would be an acceptable datafile in an R package? [ The table is a square, upper triangular matrix consisting of logs of Stirling numbers calculated by Maple. As discussed on the List a few days ago (thanks
2006 Sep 21
1
printing of complex numbers in R-alpha
Hello everyone I am finding complex numbers to be printed oddly in R-alpha. > 1e100+1e100i [1] 1e+100+1e+100i > 1e100 + 1e44i [1] 1e+100+100000000000000008821361405306422640701865984i > dput(1e100+1e44i) 1e+100+100000000000000008821361405306422640701865984i > [same thing at home on a linux box] The first line is what I would expect, the second and third lines aren't: I
2006 Jul 11
1
invalid alignment error in R-2.4.0
Hi I thought I'd pass one of my package through R CMD check with R-2.4.0 with the following result (it's clean under R-2.3.1): [snip] > > # histogram of the fourth power: > hist(out^4, col="gray") *** caught bus error *** address 0x12, cause 'invalid alignment' Traceback: 1: sort(x, partial = c(half, half + 1)) 2: sum(sort(x, partial = c(half, half +
2006 Jul 25
2
pari/gp interface
Hi I'm developing an R package that needs to execute some code written in pari/gp. I've used this before from an R package (elliptic) but the interface is very basic: the R function creates a string such as the following: string <- echo ' ellwp ([ 2+0*I , 0+2*I ], 1+0*I )' | gp -q And then system(string) returns the output from gp which then needs to be text processed
2005 Jun 13
3
extracting components of a list
Hi how do I extract those components of a list that satisfy a certain requirement? If jj <- list(list(a=1,b=4:7),list(a=5,b=3:6),list(a=10,b=4:5)) I want just the components of jj that have b[1] ==4 which in this case would be the first and third of jj, viz list (jj[[1]],jj[[3]]). How to do this efficiently? My only idea was to loop through jj, and set unwanted components to NULL,
2005 Apr 13
2
Inf +1i vs 1+Inf*1i
Hi If I have a <- Inf + 1i then Re(a) is Inf, and Im(a) is 1, as expected. But if b <- 1 + Inf * 1i, then Im(b) = Inf , as expected, but Re(b) = NaN, which I didn't expect. Why this asymmetry? How to define an object with Re(b)=1, Im(b)=Inf? -- Robin Hankin Uncertainty Analyst Southampton Oceanography Centre European Way, Southampton SO14 3ZH, UK tel 023-8059-7743
2006 Nov 17
2
do.call("+", ...)
Hi How do I make do.call() take "+" as a function for a list of more than two elements? Toy problem follows: f <- function(i){matrix((1:6)^i,2,3)} # Thus f() returns a matrix of size 2x3; I want to add a whole bunch of such matrices, # as in f(1) + f(2) + f(3) + f(4) # But: > do.call("+",sapply(1:4,f,simplify=FALSE)) Error in do.call("+",
2005 Sep 21
3
size of subplots with par() / layout()
Hi If I do this: par(mfrow=c(2,2)) persp(matrix(1:4,6,6),box=F,phi=33,theta=33) persp(matrix(1:4,6,6),box=F,phi=33,theta=33) persp(matrix(1:4,6,6),box=F,phi=33,theta=33) persp(matrix(1:4,6,6),box=F,phi=33,theta=33) ( or indeed layout(matrix(1:4,2,2)) persp . . . . ) then the mesh plots look too small to me. How do I make them larger? -- Robin Hankin Uncertainty Analyst National
2006 Feb 22
3
elements that appear only once
Hi. I have a factor and I want to extract just those elements that appear exactly once. How to do this? Toy example follows. > a <- as.factor(c(rep("oak",5) ,rep("ash",1),rep("elm",1),rep ("beech",4))) > a [1] oak oak oak oak oak ash elm beech beech beech beech Levels: ash beech elm oak > table(a) a ash beech elm oak
2006 Feb 28
2
lines() and recycled colours
Hi ?lines says For 'type = "h"', 'col' can be a vector and will be recycled as needed. Why doesn't lines() recycle colours for other types? If I type > plot(0:1,0:1,type="n") > lines(runif(11),runif(11),col=c("red","green")) > then all ten lines are red, with no warning given. Is there a reason why
2005 Feb 25
3
restoring vector v from v[-i]
Hi I have a little function that takes a vector v and an integer i. I want to manipulate v[-i] (to give v.new, say) and then put (unmanipulated) v[i] back into the appropriate place. For example, f <- function(v,i){ v.new <- v[-i]+10 return(c(v.new[1:(i-1)],v[i],v.new[i:length(v.new)])) } (my example is adding 10 to v[-i], but the real version is the solution of a complicated
2007 Mar 19
3
character to numeric conversion
Hi. Is there a straightforward way to convert a character string containing comma-delimited numbers to a numeric vector? In my application, I use system(executable.string, intern=TRUE) which returns a string like "[0.E-38, 2.096751179214927596171268230, 3.678944959657480671183123052, 4.976528845643001020345216157, 6.072390165503099343887569007, 7.007958550337542210168866070,
2006 Dec 14
4
two connected graphs
Hi I have two datasets, A and B, consisting of two columns of numbers representing x and y coordinates. They have 10 and 6 rows respectively. I want to plot two scattergraphs, one above the other. The lower graph to contain A (10 points) and the upper graph to contain B (six points). The x-axes of the two graphs must line up. I then want to draw straight lines that connect points of B to a
2008 Feb 04
2
a != a*1 != a+0 != +a
hits=1.0 tests=MANY_EXCLAMATIONS X-USF-Spam-Flag: NO Hi I am writing a package for multivariate polynomials ('multipols') using S3 methods. The package includes a Ops.multipol() function for the arithmetic methods; I would like to define some sort of user-specified Boolean option which, if set, would force results to be simplified as they are produced. Call this option
2007 Apr 27
2
system() in packages
Hello Quite often I need higher precision, or larger numbers, than IEEE double precision allows. One strategy I sometimes use is to use system() to call pari/gp, which is not constrained by IEEE. [pari/gp is a GPL high-level mathematical programming language geared towards pure mathematics] Two of my packages contain lines like the following: > system(" echo '1.12^66' |
2005 Feb 07
4
proportional matrix rows
Hi I have a two-column integer matrix like this: R> jj [,1] [,2] [1,] -1 1 [2,] -2 2 [3,] -7 6 [4,] -8 7 [5,] -6 5 [6,] -9 8 [7,] -5 4 [8,] 3 -3 [9,] -10 9 [10,] -4 3 I want a diagnostic that detects whether a row is a multiple of the first row or not. In this case, this would be rows 1,2, and 8. How to do this
2006 Sep 13
3
functions and strings
Hi If string <- "xyz" f <- function(x){1 + sin(cos(x)) + exp(x^2)} How do I manipulate "string" and f() to give the string "1 + sin(cos(xyz)) + exp(xyz^2)" ? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7743