search for: newlevel

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

Did you mean: new_level
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 > Regar...
2023 Nov 07
3
[bug report] drm/nouveau/gsp/r535: add support for booting GSP-RM
...sp_rpc_get() returns NULL on error. --> 1016 if (IS_ERR(rpc)) 1017 return PTR_ERR(rpc); 1018 1019 if (suspend) { 1020 rpc->bInPMTransition = 1; 1021 rpc->bGc6Entering = 0; 1022 rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_3; 1023 } else { 1024 rpc->bInPMTransition = 0; 1025 rpc->bGc6Entering = 0; 1026 rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_0; 1027 } 1028...
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
...; --> 1016 if (IS_ERR(rpc)) > 1017 return PTR_ERR(rpc); > 1018 > 1019 if (suspend) { > 1020 rpc->bInPMTransition = 1; > 1021 rpc->bGc6Entering = 0; > 1022 rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_3; > 1023 } else { > 1024 rpc->bInPMTransition = 0; > 1025 rpc->bGc6Entering = 0; > 1026 rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_0; >...
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
...(IS_ERR(rpc)) >> ???? 1017???????????????? return PTR_ERR(rpc); >> ???? 1018 >> ???? 1019???????? if (suspend) { >> ???? 1020???????????????? rpc->bInPMTransition = 1; >> ???? 1021???????????????? rpc->bGc6Entering = 0; >> ???? 1022???????????????? rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_LEVEL_3; >> ???? 1023???????? } else { >> ???? 1024???????????????? rpc->bInPMTransition = 0; >> ???? 1025???????????????? rpc->bGc6Entering = 0; >> ???? 1026???????????????? rpc->newLevel = NV2080_CTRL_GPU_SET_POWER_STATE_GPU_L...
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",s...
2010 Jan 29
0
[PATCH 3/3] ocfs2:freeze-thaw: make it work -v2
...tic int ocfs2_check_freeze_downconvert(struct ocfs2_lock_res *lockres, int new_level) { - return 1; /* change me */ + struct ocfs2_super *osb = ocfs2_get_lockres_osb(lockres); + struct super_block *sb = osb->sb; + int frozen_by_remote; + + mlog(0, "flags=0x%lx, frozen=%d, level=%d, newlevel=%d\n", + osb->osb_flags, sb->s_frozen, lockres->l_level, new_level); + + if (new_level == LKM_PRMODE) { + /* other node is during mount or is waiting for thaw. */ + if (sb->s_frozen) + return 0; + else + return 1; + } + + /* now new_level is NL. other node wants to free...