I'm trying to add stacked bars to a third column of a barplot and using
the following code:
year <- c(2004, 2005, 2006, 2007, 2008)
nlic <- c(5,8,6,4,2)
allow <- c(5,8,6,4,2)
shot <- c(1,6,0,1,0)
farm <- c(0,0,0,0,0)
dfs <-matrix(data=c(nlic, allow), nrow=5, ncol=2)
barplot(t(dfs), beside=T, nam
Hello everyone,
Â
I am a very new user of R and I have a query about the cuminc function in the
package cmprsk. In particular I would like to verify that I am interpreting the
output correctly when we have a stratification variable.
Â
Hypothetical example:
Â
group : fair hair, dark hair
fsta
I need help generating all possible combination of a vector of randomly
assigned values of 1 and -1. For example, a vector of 20 randomly placed 1s
and -1s, and all possibilities (which would amount to 2^20 total vectors). I
am able to generate one such vector (via sample(c(-1,1),20,replace=TR
I need help with another problem I am having that deals with the generation of
vectors that I asked about yesterday. I now need to have each value in the
vector (all values either 1 or -1) have a probability p that it will switch
signs (so, say, each value has a 50% chance of switching from -1
To clear up a question regarding my earlier posting regarding random changes in
a vector:
Say you have a vector (1, -1, -1, 1, 1, -1). I want each value in the vector
to have a probability that it will change signs when this vector is
regenerated. For example, probability = 50%. When the vec
I need help determining the unique columns of a matrix and the numbers of each
unique column. For example, let's say I have a matrix with 6 columns, 2 of
these are filled with the value of 1 and the other 4 are filled with the value
of 0. I would then like to have a command that tells me what
I need help with (hopefully) just one more thing. I have been fussing with
this for quite some time and have decided just to give up and ask! I want to
match a column in a matrix to a vector. I found a "which" command that I
thought would be helpful as it does the following:
> g=c(1,5,3,2,7)
I really need help with an if then statement I am having trouble with. A brief
explanation of what I am trying to do: I have a p matrix of all permutations of
a vector of length 3 filled with either 1s or -1s (these make up the columns).
The p.unique matrix is the unique columns of the p matri
I am running a large for loop and at the end of each iteration a matrix is
produced. The program changes the columns in the matrix, and each time a
column is added the name of that column is "y". All original columns have no
column name. Due to the nature of the program, all original columns
9 matches
Mail list logo