You might want to look at package plyr and use ddply.
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help
selected in the previous step.
Good luck!
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r
t, as this is also
the function for transposing a matrix, and could end up being confusing at
the least. Second: for most practical purposes, it's better to leave out the
*100.
Good luck,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000
making the new behavior optional (through
a new parameter na.action or similar, with the default the original
behavior) is an option?
Feel free to run your own version of rle in any case. I suggest you rename
it, though, as it may cause problems for some packages.
Nick Sabbe
--
ping: nick.sa
You might want to send this message to the Rcpp mailing list at:
Rcpp-devel mailing list
rcpp-de...@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
It will improve your chances of getting a swift (if not helpful) reply.
Nick Sabbe
--
ping
Try
(df1[order(-df1[,2]),])
Adding the minus within the [ leaves out the column (in this case column 2).
See ?[.
HTH.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original
return(c(v=vcount(g), e=ecount(g)))
})
colnames(result)-unique(dfr$Graph.ID)
print(result)
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message
, the difference surely adds up...
More improvements may be possible.
This function only works if you don't include interactions, though.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
Hi Michael.
This is a classic :-)
ObjectsOfInterest- list(one_df, two_df, three_df)
for(namedf in ObjectsOfInterest){...}
or probably even better
sapply(ObjectsOfInterest, function(namedf){...})
hth.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure
col.ticks to match the color of my abline (in the nonsimplified code), and
this works too, but unfortunately, the label below the tick is not in this
color, and a parameter for this is not present in axis.
Suggestions for either? Note: I'm on windows 7 with R 2.13.
Nick Sabbe
--
ping: nick.sa
No, that does not work.
You cannot do assignment within (l)apply.
Nor in any other function for that matter.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message
, lvar==subgroup, select=c(xvar,yvar))
Which should become something like (untested but should be close):
Data.tmp - Fulldf[Fulldf[,lvar]==subgroup, c(xvar,yvar)]
This should be a lot easier to translate based on column names, as the
column names are now used as such.
HTH,
Nick Sabbe
--
ping
, and pass that instead of c(xvarname,
yvarname) )
return(indextable)
}
myfunct.better(yes, lvarname=lvar, xvarname=xvar, yvarname=yvar,
dataframe=Fulldf)
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
an axis, use -1 in the statement above
axes3d() #Show axes
title3d(main = main, sub=paste(Green is low, ulab, , red is
high)
xlab = xlab, ylab = ylab, zlab = zlab)
}
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure
more but similar index trickery
required then.
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r
with two columns, create a vector holding the differences and the
sums of the columns - I know this can be done without *apply as well, but
apart from that it is a more attainable exercise).
Good luck to you on that!
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink
is not differentiable).
Some 'solutions' exist (bootstrap, for one), but they have all been shown to
have (statistical) properties that make them - at the least - doubtful. I
know, because I'm working on this. Short answer: there is no way to do this
(at this time).
HTH (and hang on there in Japan),
Nick Sabbe
Hello Vincy.
You probably want
y[match(z,x)]
Or, more instructional:
whereAreZInX-match(z, x)
y[whereAreZInX]
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message
misunderstanding of what comprises a generic function?
Thx,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be/ http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
[[alternative HTML version
)[k])
lapply(seq_along(mydata_list), function(j){
foo_reg(dat=mydata_list[[j]], xvar=ind.xvar, yvar=k, mycol=j,
pos=mypos[j], name.dat=names(mydata_list)[j])
return(NULL)
})
invisible(NULL)
})
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056
(see ?plot.cv.glmnet), or you can use some numerical argument
to find the reasonable extreme value for the criterion.
Really boilerplate, I guess.
Good luck.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do
the imputation, so I really need the conversion itself to work
quickly.
Thanks,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
__
R-help@r-project.org
, and noticed that R does not recognize 'plot'
as a generic function, and as such, showMethods does not work.
This seems to conflict with the documentation for plot.
So 2 questions:
. How can I find the code of plot.glmnet
. Why is plot not seen as generic?
Thx.
Nick Sabbe
Muggeo (UniPa) [mailto:vito.mug...@unipa.it]
Sent: vrijdag 28 januari 2011 14:42
To: Nick Sabbe
Cc: r-help@r-project.org
Subject: Re: [R] plot not generic
dear Nick,
getAnywhere(plot.glmnet)
Note the message you get when you type
methods(plot)
...
Non-visible functions are asterisked
Il
copy of the function, I want to make sure that when I
call pkg::plot.something, this works as before, but when, from within this
function, pkg:: plot.something.internal is called, I want it to call _my_
version of it.
Any takes?
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http
like to get the element pointed at by the list.
The obvious solutions don't seem to work, and I can't seem to get do.call to
call the indexer ('[') on my multidimensional object.
Any suggestions?
Thanks in advance,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056
,NULL)
do.call([, Ind3)
But all of these return integer(0).
So the actual new question is: how do I pass a 'missing' argument through a
do.call?
Thanks for any pointers,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09
writing my own stuff (get the number of levels per
column, then use some apply magic) to using what is there, so thanks for any
hints,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be/ http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
(levels with na: , rv, \n)
return(rv)
}
expand.combs-function(dfr, includeNA=FALSE, onlyOccurring=FALSE)
{
expand.grid(lapply(dfr, getLevels, includeNA, onlyOccurring))
}
Thx.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653
(-1,0,1,0)
rep(pattern, ceiling(n/length(pattern)))[1:n]
If you want a sequence of random real numbers between -1 and 1, use
runif(10, min=-1, max=1)
Here's hoping I haven't just solved your homework...
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure
Hi Felipe,
gsub([^0123456789], , AB15E9SDF654VKBN?dvb.65)
results in 15965465.
Would that be what you are looking for?
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original
Hello Germán.
You probably want something like:
sapply(vmat, function(curMat){
curMat[,999] != 0
})
Or if you want the indices, just surround this with a which.
HTH.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653
? Or is there any way in which this
depends on the specifics of my function (for nontrivial functions and list
sizes)?
Thanks!
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be/ http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
])
It looks like you've got a misunderstanding of how R variables work, but
maybe I just misunderstood your question...
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message
want to avoid the for loop here altogether:
y[i:10]-(i:10)+1
f[i:10]-y[(i-1):9]/2
gives you the same result, but more in the R fashion (in general, you want
to avoid explicit for loops in R)
HTH,
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653
the rest of your
code is OK)
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
an example where they prove to be the better way to go (by any criteria,
but preferably speed or perhaps other resource usage)
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message
Whenever you use a recursion (that cannot be expressed otherwise), you
always need a (for) loop.
Apply and the like do not allow to use the intermediary results (i.e. a[i-1]
to calculate a[i]).
So: no, it cannot be avoided in your case, I guess.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link
Check ?sample.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Gundala
)
}
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Sally Luo
Sent: maandag
For simple searches, use grep with fixed=TRUE.
Check ?grep.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help
consequence will be that your code will run somewhat slower.
For using some output as 'progress control' you definitely want to turn the
option off.
Nick Sabbe
--
ping: nick.sa...@ugent.be
link: http://biomath.ugent.be
wink: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do
42 matches
Mail list logo