Displaying 9 results from an estimated 9 matches similar to: "loop"
2013 Mar 14
1
ggplot2 problem
Hello all!
I have a problem with ggplot2 library. I want to do an heat map and the y
variables are the year months. If I use the following code, he y values are
in alphabetical order, but I want it in month order.
The code is:
library(reshape)
library(ggplot2)
library(scales)
p <- ggplot(data.m, aes(variable, Month)) + geom_tile(aes(fill = value),
2009 Feb 12
0
Sign differences amoung QR solutions.
I was noticing mainly sign differences amoung the solutions to QR decomposition. For example R:
> x <- matrix(c(12,-51,4,6,167,-68,-4,24,-41),nrow=3,byrow=T)
> x
[,1] [,2] [,3]
[1,] 12 -51 4
[2,] 6 167 -68
[3,] -4 24 -41
> r <- qr(x)
> r$qr
[,1] [,2] [,3]
[1,] -14.0000000 -21.0000000 14
[2,] 0.4285714 -175.0000000 70
[3,]
2012 Jul 05
2
vector entry in matix
hi,
i'm trying to figure out if there's any possibility to write a whole vector
into a matrix or data.frame or something like that. i don't mean
transormation. Here an example:
[,1] [,2]
[1,] "a" "d"
[2,] "b" "e"
[3,] "c" "f"
where e.g. a is a<-c(0,1) vector of length 2, b a vector of length 4,... (i
know that
2009 Feb 17
2
matrix output
Hi friends,
I have questions about printing a pretty big size matrix.
As you could see from below, the matrix wasn't showed in R at full size
(11X11), but it was cut partly into three smaller matrices (11X4,11X4,11X3).
I'm wondering if there is a way to show the whole matrix with dimension
11X11, do you know how to make it?
If R really couldn't fit the full big matrix at once, what
2005 Jun 07
1
Help with possible bug (assigning NA value to data.frame) ?
There's something peculiar that I do not understand here. However, did you
realize that the thing you are assigning into parts of `a' is NULL? Check
you're my.test.boot.ci.1: It's NULL.
Be that as it may, I get:
> a <- data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA)
> a
X1 X2 X3 X4
1 1 3 NA NA
2 2 4 NA NA
> a[a$X1 == 1,]$X3 <- NULL
> a
X1 X2 X3 X4
1 1
2012 Apr 16
1
arrangement
Dear All
I want to arrange our output in 3 columns in R.
Example:
N 04320 03010 00514 00604 00563 03430
03022
V 22.000000 0.000000e+00 15.0000000 15.0000 13.0000 1.300000e+01 51.0000000
p 0.640625 2.910383e-11 0.4257812 0.4375 0.6875 3.356934e-04 0.2434998
N 03060 04140 03050 00562 00565
V 20.0000000 62.00000000 273.0000000
2005 Oct 05
2
problem accumulating array within a function over loops
Dear R helpers,
I am having trouble with an array inside a loop.
I wish to accumulate the results of a function in an array within
the function, over several loops of a program outside the function.
The problem is that the array seems to re-set at every entry to the
function. Here is an example, so you can see what I mean.
2003 May 20
0
Problem on model simplification with glmmPQL
Hi all,
I try to make a split-plot with poisson errors using glmmPQL, but I
have some doubts about the model simplification.
Look my system:
Block = 3 blocks
Xvar1 = 2 levels
Xvar2 = 13 levels
Yvar = Count data Response
I need know about the behaviour of Var1, Var2 and interaction
Var1:Var2.
Look the levels:
> levels(Xvar1)
[1] "A" "B"
> levels(Xvar2)
[1]
2005 Jun 07
0
Help with possible bug (assigning NA value to data.frame)?
This 'strange behaviour' manifest itself within some quite complex
code. When I created a *very* simple example the behaviour dissapeared.
Here is the simplest version I have found which still causes the strange
behaviour (it could be quite unrelated to the boot library, however).
library(boot)
## boot statistic function
my.mean.s <- function(data,subset){
mean(data[subset])
}