Displaying 6 results from an estimated 6 matches for "math_daddy".
2010 May 17
2
retrieving last R output
Hello.
I ran a simulation that took a few days to complete, and want to analyze the
results, but have just realized that I (idiotically) did not assign the
output to a variable when I intitiated the simulation. Is there any way to
retrieve the last output produced by R so that these last few days were not
a waste?
Thank you very much.
--
View this message in context:
2012 May 15
0
How to apply a function to a multidimensional array, based on its indices
...9;s also woth noting that both use much more memory than the loop
version because the index matrix can be large.
Rui Barradas
Em 15-05-2012 11:00, r-help-request at r-project.org escreveu:
> Date: Mon, 14 May 2012 13:22:11 -0400 From: David Winsemius
> <dwinsemius at comcast.net> To: math_daddy <math_daddy at hotmail.com> Cc:
> r-help at r-project.org Subject: Re: [R] How to apply a function to a
> multidimensional array based on its indices Message-ID:
> <155F48F0-04C2-4033-A7BE-FC5109224DFA at comcast.net> Content-Type:
> text/plain; charset=US-ASCII; format=...
2010 Jul 19
2
problems with plot()
I have a list of vectors of length 2, each representing a point in 2-space,
and each of which I wish to plot on the current plot.
In a loop, I assign the x and y coordinates of the current element of the
list to variables 'x' and 'y' respectively, then make a call to plot as
follows:
par(new = TRUE)
plot(x,y, xlim = c(0,1),ylim=c(0,1), xlab <- "x", ylab <-
2012 May 15
1
Odd behaviour of identical()
Consider the following code:
test <- function(n)
{
for(x in 1:n)
{
for(y in 1:n)
{
for(r in max(x-1,1):min(x+1,n))
{
for(s in max(y-1,1):min(y+1,n))
{
vec <- c(x-r,y-s)
print(c("vec = ", vec))
print(identical(vec,c(0,0)))
}
}
}
}
}
If you run test(2) you'll see a printout of the values
2010 Jul 06
2
Odd subsetting behaviour
Hello. I've observed some odd behaviour. Most likely, it is already known and
explained somewhere, but I can't find an explanation anywhere, so I would
appreciate being pointed in the right direction.
The issue with the following code is self explanatory:
> mat <- matrix(c(c(1,1,1),c(2,2,2)),nrow=3)
> mat[,c(1:3%/%2)]
[,1] [,2]
[1,] 1 1
[2,] 1 1
[3,] 1 1
2012 May 14
3
How to apply a function to a multidimensional array based on its indices
Hello. I have a 4 dimensional array and I want to fill in the slots with
values which are a function of the inputs. Through searching the forums here
I found that the function "outer" is helpful for 2x2 matrices but cannot be
applied to general multidimensional arrays. Is there anything which can
achieve, more efficiently than the following code, the job I want?
K <-