search for: newlevels

Displaying 10 results from an estimated 10 matches for "newlevels".

2005 Aug 10
5
how to write assignment form of function
...can I find information about how to write an assigment form of a function? For curiosity I tried to write a different form of the levels()-function, since the original method for factor deletes all other attributes of a factor. Of course, the simple method would be to use instead of levels(x) <- newlevels, attr(x, 'levels') <- newlevels. I tried the following: ## example x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want x [1] a a <NA> b c d d d a b...
2005 Aug 26
2
problem with certain data sets when using randomForest
...is by changing the levels the #"Species" have to only "setosa" and "virginica", # correct me if I'm wrong. # So I tried to change the levels but I got stuck: # get the possible unique classes uniqueItems <- unique(levels(finaldataset$Species)) # the problem! newlevels <- list(uniqueItems[1] = c(uniqueItems[1], uniqueItems[2]), uniqueItems[3] = uniqueItems[3]) # Error message Error: syntax error # In the help they use constant names to rename the #levels, so this works (but that's not what I want #because I don't want to change the code every time I...
2006 Nov 14
4
c.factor
...: > x [1] a b c d e Levels: a b c d e > y [1] d e f g h Levels: d e f g h > c(x,y) [1] 1 2 3 4 5 1 2 3 4 5 > Is there a case for a new method c.factor as follows? Does something similar exist already? Is there a better way to write the function? > c.factor = function(x,y) { newlevels = union(levels(x),levels(y)) m = match(levels(y), newlevels) ans = c(unclass(x),m[unclass(y)]) levels(ans) = newlevels class(ans) = "factor" ans } > c(x,y) [1] a b c d e d e f g h Levels: a b c d e f g h > as.integer(c(x,y)) [1] 1 2 3 4 5 4 5 6 7 8 > Regard...
2023 Nov 07
3
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
Hello Ben Skeggs, The patch 176fdcbddfd2: "drm/nouveau/gsp/r535: add support for booting GSP-RM" from Sep 19, 2023 (linux-next), leads to the following Smatch static checker warning: drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1016 r535_gsp_rpc_unloading_guest_driver() warn: 'rpc' isn't an ERR_PTR drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c 1010 static int
2010 Feb 03
1
[PATCH] ocfs2: Plugs race between the dc thread and an unlock ast message
This patch plugs a race between the downconvert thread and an unlock ast message. Specifically, after the downconvert worker has done its task, the dc thread needs to check whether an unlock ast made the downconvert moot. Reported-by: David Teigland <teigland at redhat.com> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> Acked-by: Mark Fasheh <mfasheh at sus.com> ---
2023 Nov 07
2
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
On 11/7/23 15:34, Dan Carpenter wrote: > Hello Ben Skeggs, > > The patch 176fdcbddfd2: "drm/nouveau/gsp/r535: add support for > booting GSP-RM" from Sep 19, 2023 (linux-next), leads to the > following Smatch static checker warning: > > drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1016 r535_gsp_rpc_unloading_guest_driver() > warn: 'rpc' isn't an
2010 Feb 04
4
Why is there no c.factor?
Hi all, Is there are reason that there is no c.factor method? Analogous to c.Date, I'd expect something like the following to be useful: c.factor <- function(...) { factors <- list(...) levels <- unique(unlist(lapply(factors, levels))) char <- unlist(lapply(factors, as.character)) factor(char, levels = levels) } c(factor("a"), factor("b"),
2023 Nov 07
1
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
On 11/7/23 20:00, Danilo Krummrich wrote: > On 11/7/23 15:34, Dan Carpenter wrote: >> Hello Ben Skeggs, >> >> The patch 176fdcbddfd2: "drm/nouveau/gsp/r535: add support for >> booting GSP-RM" from Sep 19, 2023 (linux-next), leads to the >> following Smatch static checker warning: >> >> ????drivers/gpu/drm/nouveau/nvkm/subdev/gsp/r535.c:1016
2013 Apr 19
2
NAMESPACE and imports
...cph,catg,combineRelatedPredictors,confplot,contrast,coxphFit,cph,cr.setup,datadist,effective.df,fastbw,formatNP,gendata,gIndex,GiniMd,Glm,Gls,groupkm,Hazard,hazard.ratio.plot,histdensity,"%ia%",ie.setup,interactions.containing,legend.nomabbrev,lm.pfit,lrm,lrtest,lsp,matinv,matrx,Newlabels,Newlevels,nomogram,num.intercepts,ols,ols.influence,oos.loglik,pantext,Penalty.matrix,Penalty.setup,pentrace,perimeter,perlcode,plot.xmean.ordinaly,pol,pphsm,predab.resample,Predict,psm,rcs,related.predictors,reVector,robcov,Rq,sascode,scored,sensuc,setPb,show.influence,specs,strat,Surv,"[.Surv",su...
2010 Jan 29
0
[PATCH 3/3] ocfs2:freeze-thaw: make it work -v2
This patch adds freeze_fs()/unfreeze_fs() for ocfs2 so that it supports freeze/thaw. Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com> --- fs/ocfs2/dlmglue.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++- fs/ocfs2/dlmglue.h | 2 + fs/ocfs2/journal.c | 1 + fs/ocfs2/ocfs2.h | 12 +++++ fs/ocfs2/super.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++-