Displaying 6 results from an estimated 6 matches for "tmpmat".
Did you mean:
tmpdat
2011 Apr 06
1
Error in match.names(clabs, names(xi))
...distinct times
#Gastric$time is all the time points either death or largest obervation
time.
#srvGastA$time is all the unique times
newGas <- data.frame(start=0, stop=1, Dth=1, Ploidy=1, tim=0)
#newGas <- r(0,1,1,1,0)
for (i in 2:90) {
timind <- match(Gastric$time[i],srvGastA$time)
tmpmat <- array(0, dim=c(timind,5))#build an array with dim('index',5)
tmpmat[,4] <- rep(Gastric[i,1], timind)#fourth column, return i's group
tmpmat[timind,3] <- Gastric$Dth[i]
tmpmat[,1] <- if(timind>1) c(0,srvGastA$time[1:(timind-1)]) else 0
tmpmat[,2] <- s...
2012 May 21
1
Changing selected elements of an array
...selected positions seems more difficult. When I use the geographical
positions of the data.frame as index, blobs are changed and not individual
elements.
How can I circumvent this feature of R?
E.g: in this situation I would like the downward diagonal to be changed, not
the square box...
> tmpmat <-
matrix(NA,nrow=9,ncol=10,dimnames=list(formatC(tmplat,format="f",digits=2),formatC(tmplon,format="f",digits=2)))
> tmpmat
8.00 9.50 9.75 14.25 15.00 15.75 18.00 20.50 21.75 25.25
55.25 NA NA NA NA NA NA NA NA NA NA
56.75 NA NA NA...
2007 Jul 31
1
A complicated 'aggregate'
...1000
I currently do this using a loop, and the result is abysmally slow:
f <- function(x)
{
retval <- c(0, 0);
x <- coredata(x);
retval[2] <- sum(x[,2]);
retval[1] <- sum(x[,1] * x[,2]) / retval[2];
retval;
}
#ts is a zoo timeseries
uniqueTimes <- unique(index(ts))
tmpMat <- NULL
for(i in 1:length(uniqueTimes))
{
tmpMat <- rbind(tmpMat, f(ts[uniqueTimes[i]]));
}
ts.agg <- zooreg(tmpMat, order.by=uniqueTimes);
I'm sure the above can be done with aggregate or tapply or by or something,
but I haven't managed to get those to work.
Any suggestion...
2009 Jan 22
2
blowup portion of graph beside it
Hi,
I'd like to blow up portions of my graph and put it in boxes beside the
graph.Is there an addon to do this?
--
Rajesh.J
[[alternative HTML version deleted]]
2013 Feb 28
4
Iteration through a list in R
Hello :)
I'm just starting out with R and would appreciate your help with a couple
of problems I am running into.
I have used Sys.glob to get a list of all filenames having a particular
file extension (in my case, *.txt)
I would now like to use this list in the following manner: I would like to
use each filename from the list and open that file into a tab separated
matrix and proceed.
How can
2000 Nov 01
3
triangular matrix
How I make the below matrix
| a^0 0 0 ... 0 |
| a^1 a^0 0 ... 0 |
| a^2 a^1 a^0 ... 0 |
| . |
| . |
| . |
| a^n a^(n-1) a^(n-2) ... a^0 |
with no loops, where "a" is a constant?
========================================================================
C?zar de Freitas
Depto. de Estat?stica - UFPE
Recife - Pernambuco - Brasil