Thanks Sven,
I started with the first function.
The values are not in a list but in df. it is more easy for me
the output is a df:
Genesbrca_tcga gbm_tcga color_brca color_gbm
name1 v1v2col1 col2
name2 v3v4
Hello, I am trying to handle more gracefully the issue that occurs when one
attempts to install a new version of a package whose library is currently
loaded. When one does this the functions in the package work but when one
tries to view the documentation a warning pop is given and the followin
Thanks. A useful tip for a long-time SAS user.
James F. Henson
On Fri, Jun 5, 2015 at 3:47 AM, Gerrit Eichner <
gerrit.eich...@math.uni-giessen.de> wrote:
> Hello, everyone,
>
> aside from Rolf's hint (and Richard's warning!) you could also consider
> relevel():
>
> viagraData$dose <- relevel( vi
Hello,
I am estimating a nonlinear GMM and I got the following error message. I have
searched online in other to understand what is going on but could not find help
> ngmm = optimx(par=b0, fn=object,gr=gred, method = c("BFGS","nlminb","nlm"),
> itnmax=1, control=list(follow.on = TRUE,startte
Hi all,
I am fitting a random slope and random intercept model usign lme
fucntion as shown below. Type is factor with two levels. I would like
to to find a confidence interval for mean of this model. Note that the
variance we use in finding the confidence interval should include the
variariance c
> Christophe Genolini
> on Fri, 5 Jun 2015 00:36:42 -0700 writes:
> Hi all,
> There is a compatibility issue between the package 'lme4' and my package
> 'kml'. I define the "[" operator. It works just fine in my package (1).
If I
> try to use the lme4 package, then it
Hi Karim,
you should learn ?Map to iterate along the list and supply mutliple list
arguments (there is also parallel:::mcMap for multicore).
The magic of the color code generation you figure out yourself, I guess...
Here 'i' intends to be the value, 'n' the name, e.g.
# returns color by charact
Hi all,
I have a list like this
expBefore <-
list(HM450=list(brac_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03),
gbm_tcga=list("ATM"=0.19,"ATR"=0.02,"BRCA1"=0.02,"BRCA2"=0.89,"CHEK1"=0.71,"CHEK2"=0.03)
),
HM27=list(brac_tcga=list("ATM"=0.19,
One more note. There is actually a valid reason to use `levels<-`, and that is
to change the spelling of the levels while maintaining the existing order.
> tmp <- factor(c("mm", "cm", "dm", "m", "km"))
> tmp
[1] mm cm dm m km
Levels: cm dm km m mm
> levels(tmp) <- c("centimeter","decimeter","kil
Does the following do what you want?
> d <- list() # empty list
> for(i in 1:8) if (i %% 2 == 0) {
newElement <- structure(list(i), names=LETTERS[i])
d <- c(d, newElement)
}
> str(d)
List of 4
$ B: int 2
$ D: int 4
$ F: int 6
$ H: int 8
Bill Dunlap
TIBCO Software
wdunlap tibco.c
Your explanation of the problem is unclear and your use of HTML formatting
corrupts your code examples.
One issue is your reference to a loop while showing no loop nor input nor
output. There is more than one construct for iterating in R. One problem you
may be encountering is that you cannot c
> Martin Morgan
> on Thu, 4 Jun 2015 10:33:37 -0700 writes:
> On 06/04/2015 10:08 AM, cgenolin wrote:
>> Hi the list,
>>
>> I have a variable y that is either NA or some S4 object. I would like to
>> know in which case I am, but it seems taht is.na does not work w
Thank you very much!
Il 05/giu/2015 15:58, "David L Carlson" ha scritto:
> You can select elements of a matrix using a 2 dimensional matrix that
> specifies the row/column number of the cells you want to extract:
>
> > c2 <- cbind(seq_len(nrow(c0)), c1)
> > c2
>c1
> [1,] 1 2
> [2,] 2 2
You can select elements of a matrix using a 2 dimensional matrix that specifies
the row/column number of the cells you want to extract:
> c2 <- cbind(seq_len(nrow(c0)), c1)
> c2
c1
[1,] 1 2
[2,] 2 2
[3,] 3 1
[4,] 4 2
[5,] 5 1
[6,] 6 1
> d1 <- c0[c2]
> d1
[1] -1 -3 12 2 -23 17
Thank you, of course but I can't use that form as I told. My question is
about the possibility to enter in a dataframe with a matrix of indices and
get the corresponding values
Thanks again
Il 05/giu/2015 15:39, "John Kane" ha scritto:
> d1 <- apply(c0, 1, min) I think does it.
>
> John Kane
Please do not post in HTML. It made your posting unreadable. R-help is a plain
text list and when it removes all the HTML tags often the result is gibberish
Have a look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
and http://adv-r.had.co.nz/Reproduci
d1 <- apply(c0, 1, min) I think does it.
John Kane
Kingston ON Canada
> -Original Message-
> From: sergio.fond...@gmail.com
> Sent: Fri, 5 Jun 2015 15:06:34 +0200
> To: r-help@r-project.org
> Subject: [R] Matrix of indexes to extract sparse data in dataframe
>
> I would like to avoid
I would like to avoid a "for loop" to get a vector of data taken from
rows of a data frame for specific columns.
An example is the following (I can't apply min to every row of df, this is
just an example):
c0=data.frame(a=c(3,-2,12,7,-23,17) , b=c(-1,-3,14,2,6,19))
c1=apply(c0,1,which.min)
> c1
[1
Hi
I will not inspect your function as it is corrupted by HTML posting.
If your data frame is named rain
newrain <- (rain>.1)*1
gives you new data frame with reqired coding.
However I am not sure, what do you want to do next. Do you want to merge those
2 data frames so as coded column is besi
Dear community,
Could somebody help on how I can change the colour for this plot in the
heatmap plot script below to something like c("green", "green", "black",
"green", "green", "black", "black", "green", "green", "black"):
##
library(gplots)
library(lattice)
### loading data
data <- read.
Dear r-users,
I have a set of rain data:
X1950 X1951 X1952 X1953 X1954 X1955 X1956 X1957 X1958 X1959 X1960 X1961
X1962
1 0.0 0.0 14.3 0.0 13.5 13.2 4.0 0 3.3 0 0 0.0
2 0.0 0.0 21.9 0.0 10.9 6.6 2.1 0 0.0 0 0 0.0
3 25.3 6.7 18.6 0.8
Hi r-help,
I am trying to develop a program in R where I want to display the
out put result in a HTML page. But I unable to put two tables side by side
which is required to me. Another problem is that I unable to put the title
in the center of the
page. The code is given below.
Please help me.
Hi
I do not understand. „i“ is variable and list elements are called by this
variable
#constructing list
> d<-as.list(sample(letters[1:5], 5, replace=F))
> names(d) <- letters[1:5]
> d
$a
[1] "c"
$b
[1] "a"
$c
[1] "e"
$d
[1] "b"
$e
[1] "d"
#variable el
> el<-"a"
#result
> d[[el]]<-"whatever I
Having trouble getting melt and dcast to work with ffdf
I'm trying to cast 3 columns to a square matrix
With a regular data.frame.
comb <- expand.grid((1:10),(1:10))
dim(comb)
comb$Dist <- (1:100)
c.melt <- melt(comb, id.vars=c("Var1","Var2"))
dcast(c.melt,Var2~Var1)
goes from
> comb
V
Here is the best solution that I found as the list is built in the embedded
functions withtout using loop index, list elements' names etc
d = list()d[[length(d)+1]] = 1:3d[[length(d)+1]] = 4:6
Many thanks for your help
On Friday, June 5, 2015 12:04 PM, PIKAL Petr
wrote:
#yiv172814
in this example can elements of the list be accessed by their name if their
name is the value of a variable?el = "a"can the first element d[[1]] be
accessed by el instead of the list index like d$a but via el?
Thanks
On Friday, June 5, 2015 12:04 PM, PIKAL Petr
wrote:
#yiv1728143
> Martin Maechler
> on Fri, 5 Jun 2015 11:33:46 +0200 writes:
> Christophe Genolini
> on Fri, 5 Jun 2015 00:36:42 -0700 writes:
>> Hi all,
>> There is a compatibility issue between the package 'lme4' and my package
>> 'kml'. I define the "[" operator. It work
Hi
This I do not consider as a loop without index. AFAIK i is index and the loop
is executed twice. First with i equal to „a“ and second time with i equal to
„b“.
In that case you need to have some objects which are named “a” or “b” and you
can use it for selection or computing
d<-list(a=NU
Hi
Can you please specify how loop without index shall be constructed? It is
rather new topic for me.
Petr
From: carol white [mailto:wht_...@yahoo.com]
Sent: Friday, June 05, 2015 11:21 AM
To: PIKAL Petr
Subject: Re: [R] building a list in a loop
also consider a loop without index (not like fo
Hi
I do not understand. My mind reading ambilities are limited.
Where do you get your vectors from?
Instead of
vec<-vec+3*(i-1)
you can use any computation to create any object.
d<-list()
n=2
for (i in 1:n) {
s<-sample(1:26, 10, replace=FALSE)
rn<-rnorm(10)
y<-rn*s*rnorm(1)+rnorm(1)
fit<-lm(y~
> Christophe Genolini
> on Fri, 5 Jun 2015 00:36:42 -0700 writes:
> Hi all,
> There is a compatibility issue between the package 'lme4' and my package
> 'kml'. I define the "[" operator. It works just fine in my package (1).
If I
> try to use the lme4 package, then it
Hello, everyone,
aside from Rolf's hint (and Richard's warning!) you could also consider
relevel():
viagraData$dose <- relevel( viagraData$dose, ref = "placebo")
Hth -- Gerrit
On Fri, 5 Jun 2015, Rolf Turner wrote:
On 05/06/15 11:08, Jim Lemon wrote:
Hi James,
You can change the order
It might be an easy question but how to construct correctly a list in a loop?
The following doesn't work
before starting the loopd = NULL#in the loop, 1st iteration
d = list(d,c(1,2,3)d[[1]]
NULL
[[2]]
[1] 1 2 3#in the loop, 2nd iterationd=list(d,c(4,5,6)d
[[1]]
[[1]][[1]]
NULL
[[1]][[2]]
[1] 1
Hi all,
There is a compatibility issue between the package 'lme4' and my package
'kml'. I define the "[" operator. It works just fine in my package (1). If I
try to use the lme4 package, then it does no longer work (2). Moreover, it
has some kind of strange behavior (3). Do you know what is wrong?
So easy!
Thanks a lot.
--
View this message in context:
http://r.789695.n4.nabble.com/is-na-for-S4-object-tp4708201p4708234.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more
35 matches
Mail list logo