Codebase list hmisc / upstream/4.7-2
New upstream version 4.7-2 Dirk Eddelbuettel 1 year, 5 months ago
17 changed file(s) with 161 addition(s) and 85 deletion(s). Raw diff Collapse all Expand all
00 Package: Hmisc
1 Version: 4.7-1
2 Date: 2022-08-13
1 Version: 4.7-2
2 Date: 2022-11-18
33 Title: Harrell Miscellaneous
44 Authors@R:
55 c(person(given = "Frank E",
1717 Imports: methods, latticeExtra, cluster, rpart, nnet, foreign, gtable,
1818 grid, gridExtra, data.table, htmlTable (>= 1.11.0), viridis,
1919 htmltools, base64enc
20 Suggests: acepack, chron, rms, mice, tables, knitr, plotly (>= 4.5.6),
21 rlang, plyr, VGAM
20 Suggests: acepack, chron, rms, mice, rstudioapi, tables, knitr, plotly
21 (>= 4.5.6), rlang, plyr, VGAM
2222 Description: Contains many functions useful for data
2323 analysis, high-level graphics, utility operations, functions for
2424 computing sample size and power, simulation, importing and annotating datasets,
3131 Encoding: UTF-8
3232 RoxygenNote: 7.1.2
3333 NeedsCompilation: yes
34 Packaged: 2022-08-13 16:19:03 UTC; harrelfe
34 Packaged: 2022-11-18 21:34:48 UTC; harrelfe
3535 Author: Frank E Harrell Jr [aut, cre] (<https://orcid.org/0000-0002-8271-5493>),
3636 Charles Dupont [ctb] (contributed several functions and maintains latex
3737 functions)
3838 Repository: CRAN
39 Date/Publication: 2022-08-15 08:30:07 UTC
39 Date/Publication: 2022-11-18 23:10:06 UTC
+16
-16
MD5 less more
00 16f8ea43efba90112351c5ecb33021c4 *COPYING
1 4f4db629bb7f3c02c2d3e3eb1383ae93 *DESCRIPTION
2 69ecc0f3b7619c0c9c485f9e4090876b *NAMESPACE
3 29f47d500e691390810394ac086e08d6 *NEWS
1 82b2ae379b6767250be8cb87fa3de2d1 *DESCRIPTION
2 5992b9f2844076f7afd6b4e6bfd6f3d5 *NAMESPACE
3 63e15b1afbf17d92df36ef95a76e7e19 *NEWS
44 76f90acbe9bf8ad2eaaa6b8813eb7c82 *R/AFirst.lib.s
55 8fdbfa3b900cbbb42d94898093ec7fa5 *R/Cs.s
66 85683865508739ff7a19b280e562ab67 *R/GiniMd.s
77 7d0b0014572f85d46fa6a3417707344c *R/Key.s
8 b4731cac9abe82106e4b535a77f688d2 *R/Merge.r
9 9c7f09bcf89619e07189e8f7552e7c4f *R/Misc.s
8 10afe48276f47fe7b9cbeba8b151ee42 *R/Merge.r
9 0091bb7f60a12a811825db0b06fb01ef *R/Misc.s
1010 081320dfb53e3362cfb0918952b60cce *R/R2Measures.r
1111 9043da0ab6b8288636bb399cdb0f89bf *R/abs.error.pred.s
1212 bdf1cbb1952b1cdf53a296a6d29ecb08 *R/areg.s
3030 97dc5dcc48cb719088b817833067352c *R/dataRep.s
3131 ec8af558be91e1fa3415f1a99dd469b2 *R/dates.s
3232 3f02d2486d14e095a96fe5ee10e483c7 *R/deff.s
33 c7e75ba0cf44a10c97633ab3a82e5beb *R/describe.s
33 7c467c898b81b927a07e19bfbc50ffc5 *R/describe.s
3434 6cb5b3a77860b605f102bb528e84a071 *R/discrete.s
3535 510723f9ba799696bf0196fc231e2ca2 *R/dotchart3.s
3636 14ad428dacb6bed7013fdef6c05d9239 *R/dotchartpl.s
6363 8cf9e0a10997c59a5be3f19a39c73684 *R/james.stein.s
6464 8015b8ce84b2cc4686fca6ebba40e916 *R/labcurve.s
6565 bb1e0963d40b2a6df05f9277484c5ebb *R/label.s
66 838bc6afccec32608b1bc14fc05d27e6 *R/latex.s
66 526e1c9a614e4914908b00f675466117 *R/latex.s
6767 4e31dcfc293ca68d459764b5d32515f3 *R/latexCheckOptions.r
6868 dda324419c115accb95440b58d422d43 *R/latexDotchart.s
6969 b160964c8423acea603c95a04c791084 *R/latexTabular.s
7070 67c8a6450a4ead25d7fe5a7944a40d12 *R/latexTherm.s
7171 f15937a81b1e2a57a9707f5fbdd6c878 *R/list.tree.s
7272 ce608a6c653ec8c6fe828448f9a78eb6 *R/mApply.s
73 2d052be3962a7b8042d0cef39231d48d *R/mChoice.s
73 d62470527f34181cace3f8935e4e35ea *R/mChoice.s
7474 e21c3cbb9b9c17b07223d4f805433395 *R/makeNstr.s
7575 e5f0eef89d954522d56fb5399066a6d3 *R/mask.s
7676 f4cc097babcda3c1edcd60f516713ff2 *R/matxv.s
140140 eb87b4f621bfa787f568ceca584f9240 *R/tabulr.s
141141 c1dba69a612fd6fb121adb946a77596e *R/tex.s
142142 2b30ea0d0be2d1eca4d07d2bcd1cc2aa *R/transace.s
143 9eb090abfa2d4a84995078c72761f3eb *R/transcan.s
143 d1bfd0b35c0217dfd3b3d9b96929142b *R/transcan.s
144144 847daf7fa4e67d6641c763a7873df93c *R/translate.s
145145 91c82b7b8e9ad8cff084bf7b2069d11b *R/units.s
146146 9cc4a154ada63f71e4eb19c38453e445 *R/upData.s
238238 71a62f91bcd26f7cbfa9a2755bed0830 *man/Save.Rd
239239 79ed6280942247ec7b4580638c1cc885 *man/abs.error.pred.Rd
240240 6ed0de6a1ac299e867fea5c42fd49024 *man/addMarginal.Rd
241 2db34295a22ca5a59d3557f50e4ac2e7 *man/all.is.numeric.Rd
241 77a208cf321e5241f5e11e4dbb6d101e *man/all.is.numeric.Rd
242242 89bde30f0578686f86512ffe08e7e4be *man/approxExtrap.Rd
243243 03eed851f558773c200c8e2e09c9fff3 *man/areg.Rd
244244 162611103783a62d004aa9af0666690a *man/aregImpute.Rd
282282 ebdd21800ffc4beea994eaac7d5b4668 *man/gbayes.Rd
283283 47920142f9583c30c3b4bbd60d9a3035 *man/gbayesSeqSim.Rd
284284 bd9c601a3778a3bc502d85fa39dcb058 *man/getHdata.Rd
285 cf232c11fafdccc1efa3a6b67a3708c0 *man/getRs.Rd
285 2e3625a44c067d7004d304ca7940e9f6 *man/getRs.Rd
286286 c10b701ac0c5fbf3a3a3654378694a1c *man/getZip.Rd
287287 ac60ee276185df5b27c0819a3e781bae *man/ggMisc.Rd
288288 da13083c7f23c4a36a1b49ccfc1e87e3 *man/ggfreqScatter.Rd
289289 988163ff858c2a7b23ed89d50e056403 *man/ggplotlyr.Rd
290290 bd30d6597a6591b2d3b6202931502245 *man/hdquantile.Rd
291 9bde85cef5a8815e6a4adbc2163aa870 *man/hidingTOC.Rd
291 3ad9255f40b316ad3c4349c842daad6a *man/hidingTOC.Rd
292292 8256dd2a02e789ad86ec974fa90420cd *man/hist.data.frame.Rd
293293 901875cc993a500f248fb22af00183d4 *man/histbackback.Rd
294294 450305dcabbc06b9fb94f85d4dd4dbb0 *man/histboxp.Rd
299299 396c791f149027eeafaa9515e93d3d27 *man/knitrSet.Rd
300300 8fcd85e7402db30d54a27e1222355606 *man/labcurve.Rd
301301 af738949158db99a2448cb48d3b310d3 *man/label.Rd
302 b4e0d1d0f22212f7e2c5b31f570196a4 *man/latex.Rd
302 bebcb911d2f805ec0079cf0d7e4c02c7 *man/latex.Rd
303303 9c1dfa5242426105b1ca4669b0977997 *man/latexCheckOptions.Rd
304304 c4a248262270a156d9723212daba90ff *man/latexDotchart.Rd
305305 32f49f9726f15c0cae64179b3df74f20 *man/latexTabular.Rd
307307 e110de27ad37decbe96987691beb7555 *man/legendfunctions.Rd
308308 3e0817d289b96a7d59847a1144f5fa59 *man/list.tree.Rd
309309 a327d909648492c3e5b524888e27c35a *man/mApply.Rd
310 0d4948a3cd6757749816fbb2cdb6f96b *man/mChoice.Rd
310 f66d70a00d4ac8c6e69a916c41a23871 *man/mChoice.Rd
311311 c2c3d7fd7b6118a5480308fcacb57afa *man/makeNstr.Rd
312312 1f4cb5e4cb669550dc4aca2745280286 *man/mdb.get.Rd
313313 ad5ca5884567e50edeba874e3f6e0566 *man/mgp.axis.Rd
329329 a3aed45d350c39121d61700f94e859cb *man/plotCorrPrecision.Rd
330330 88d93c5117d432cbe4ba996c5c74d0d8 *man/plotlyM.Rd
331331 81937c2b724d0ec42f817ebb88748e70 *man/plsmo.Rd
332 4af8df34929b776410ae3b007f01a15f *man/popower.Rd
332 a05ef4564d6773ed63e6430f9d52eae7 *man/popower.Rd
333333 52be83076b1f0442cb5ab5c15bb16a3f *man/print.char.list.Rd
334334 0a25e1c6f349789159b7239ae0f0f620 *man/print.char.matrix.Rd
335335 057da98d466a023bda3991abbf880855 *man/prnz.Rd
409409 2d0aa4a90313d361f628383dd5fcf7fb *src/mChoice.c
410410 703f73252fe6efaf8244b0713aaabe6b *src/maxempr.f
411411 69d3a08b2cd911161ba22af68f97f611 *src/nstr.c
412 f698976ca9ef8a852edd2c37939b66a2 *src/ranksort.c
412 5fd3cecbf580b3cb32f365f1f9036794 *src/ranksort.c
413413 df53032c14b9c8a41bfe9529411c7729 *src/ratfor/cidxcn.r
414414 ebb3e56a96c8678a2e3184d176af9926 *src/ratfor/cidxcp.r
415415 4549893e527bae0e3140b29579c74720 *src/ratfor/hoeffd.r
0 export("%nin%",.q,abs.error.pred,addMarginal,all.digits,all.is.numeric,approxExtrap,areg,areg.boot,aregImpute,aregTran,arrGrob,as.discrete,asNumericMatrix,ballocation,bezier,binconf,biVar,bootkm,bpower,bpower.sim,bpplot,bpplotM,bpplt,bppltp,bpx,bsamsize,bystats,bystats2,capitalize,catTestchisq,Cbind,ceil,character.table,chiSquare,ciapower,cleanup.import,clowess,cnvrt.coords,code.levels,colorFacet,combine.levels,combineLabels,combplotp,confbar,consolidate,contents,conTestkw,cpower,Cs,csv.get,cumcategory,curveRep,curveSmooth,cut2,datadensity,dataDensityString,dataframeReduce,dataRep,ddmmmyy,deff,describe,discrete,dhistboxp,dotchart2,dotchart3,dotchartp,dotchartpl,Dotplot,drawPlot,dvi,dvigv,dvips,ecdfpM,Ecdf,equalBins,errbar,escapeBS,escapeRegex,estSeqMarkovOrd,estSeqSim,event.chart,event.convert,event.history,expr.tree,fillin,find.matches,first.word,fit.mult.impute,format.df,format.pval,formatCats,formatCons,formatDateTime,formatdescribeSingle,formatSep,formatTestStats,ftupwr,ftuss,Function,gbayes,gbayes1PowerNP,gbayes2,gbayesMixPost,gbayesMixPowerNP,gbayesMixPredNoData,gbayesSeqSim,get2rowHeads,getHdata,getLatestSource,GetModelFrame,getRs,getZip,ggfreqScatter,ggplotlyr,GiniMd,Gompertz2,groupn,grType,hdquantile,hidingTOC,hist.data.frame,histbackback,histboxp,histboxpM,histSpike,histSpikeg,hoeffd,html,htmlGreek,htmlSN,htmlSpecial,htmlSpecialType,htmlTranslate,htmlVerbatim,importConvertDateTime,improveProb,impute,impute.transcan,inmChoice,intMarkovOrd,inverseFunction,invertTabulated,is.discrete,is.imputed,is.mChoice,is.present,is.special.miss,james.stein,jitter2,keepHattrib,Key,Key2,km.quick,knitrSet,labcurve,label,Label,labelLatex,labelPlotmath,Lag,largest.empty,latex,latexBuild,latexCheckOptions,latexDotchart,latexNeedle,latexSN,latexTabular,latexTherm,latexTranslate,latexVerbatim,list.tree,llist,lm.fit.qr.bare,Load,Lognorm2,logrank,lookupSASContents,lrcum,makeNames,makeNstr,makeSteps,mApply,markupSpecs,mask,match.mChoice,matchCases,matrix2dataFrame,matxv,mbarclPanel,mbarclpl,mChoice,mdb.get,Mean,medvPanel,medvpl,Merge,mgp.axis,mgp.axis.labels,mhgr,minor.tick,monotone,monthDays,mtitle,multEventChart,multLines,na.delete,na.detail.response,na.include,na.keep,na.pattern,na.retain,naclus,nafitted.delete,Names2names,naplot,napredict.delete,naprint.delete,naprint.keep,naresid.delete,naresid.keep,nFm,nobsY,nomiss,nstr,num.denom.setup,num.intercepts,numeric.string,numericScale,oPar,optionsCmds,ordGridFun,ordTestpo,outerText,pairUpDiff,panel.bpplot,panel.Dotplot,panel.Ecdf,panel.plsmo,panel.xYplot,parGrid,partition.matrix,partition.vector,pasteFit,pBlock,pc1,plotCorrM,plotCorrPrecision,plotp,plotlyM,plotlyParm,plotlySave,plotmathTranslate,plotMultSim,plotpsummaryM,plsmo,pngNeedle,pomodm,popower,posamsize,prepanel.Dotplot,prepanel.Ecdf,prepanel.xYplot,print.char.matrix,prList,prn,propsPO,propsTrans,prselect,prType,pstamp,putHcap,putHfig,putKey,putKeyEmpty,Quantile,Quantile2,R2Measures,rcorr,rcorr.cens,rcorrcens,rcorrp.cens,rcspline.eval,rcspline.plot,rcspline.restate,rcsplineFunction,read.xportDataload,readSAScsv,redun,reformM,reLabelled,replace.substring.wild,reShape,responseSummary,restoreHattrib,rlegend,rlegendg,rm.boot,rMultinom,roundN,roundPOSIXt,samplesize.bin,sas.codes,sas.get,sas.get.macro,sasdsLabels,sasxport.get,Save,scat1d,score.binary,sedit,sepUnitsTrans,setParNro,setTrellis,show.col,show.pch,showPsfrag,simMarkovOrd,simplifyDims,simPOcuts,simRegOrd,sKey,smean.cl.boot,smean.cl.normal,smean.sd,smean.sdl,smearingEst,smedian.hilow,solvet,somers2,soprobMarkovOrd,soprobMarkovOrdm,spearman,spearman.test,spearman2,spower,spss.get,src,stat_plsmo,stata.get,StatPlsmo,stepfun.eval,stratify,strgraphwrap,string.bounding.box,string.break.line,stringDims,stripChart,subplot,substi,substi.source,substring.location,substring2,summarize,summaryD,summaryDp,summaryM,summaryP,summaryRc,summaryS,symbol.freq,sys,t.test.cluster,table_formatpct,table_freq,table_latexdefs,table_N,table_pc,table_trio,tabulr,termsDrop,testDateTime,tex,tobase64image,transace,transcan,translate,trap.rule,trellis.strip.blank,truncPOSIXt,uncbind,units,unPaste,upData,upFirst,valueLabel,valueName,valueTags,valueUnit,var.inner,varclus,Weibull2,whichClosek,whichClosePW,whichClosest,wtd.Ecdf,wtd.loess.noiter,wtd.mean,wtd.quantile,wtd.rank,wtd.table,wtd.var,xInch,xless,xy.group,xYplot,xySortNoDupNoNA,yearDays,yInch,ynbind,zoom,"[<-.discrete","consolidate<-","is.na<-.discrete","label<-","length<-.discrete","substring2<-","valueLabel<-","valueName<-","valueTags<-","valueUnit<-")
0 export("%nin%",.q,abs.error.pred,addMarginal,all.digits,all.is.numeric,approxExtrap,areg,areg.boot,aregImpute,aregTran,arrGrob,as.discrete,asNumericMatrix,ballocation,bezier,binconf,biVar,bootkm,bpower,bpower.sim,bpplot,bpplotM,bpplt,bppltp,bpx,bsamsize,bystats,bystats2,capitalize,catTestchisq,Cbind,ceil,character.table,chiSquare,ciapower,cleanup.import,clowess,cnvrt.coords,code.levels,colorFacet,combine.levels,combineLabels,combplotp,confbar,consolidate,contents,conTestkw,cpower,Cs,csv.get,cumcategory,curveRep,curveSmooth,cut2,datadensity,dataDensityString,dataframeReduce,dataRep,ddmmmyy,deff,describe,discrete,dhistboxp,dotchart2,dotchart3,dotchartp,dotchartpl,Dotplot,drawPlot,dvi,dvigv,dvips,ecdfpM,Ecdf,equalBins,errbar,escapeBS,escapeRegex,estSeqMarkovOrd,estSeqSim,event.chart,event.convert,event.history,expr.tree,fillin,find.matches,first.word,fit.mult.impute,format.df,format.pval,formatCats,formatCons,formatDateTime,formatdescribeSingle,formatSep,formatTestStats,ftupwr,ftuss,Function,gbayes,gbayes1PowerNP,gbayes2,gbayesMixPost,gbayesMixPowerNP,gbayesMixPredNoData,gbayesSeqSim,get2rowHeads,getHdata,getLatestSource,GetModelFrame,getRs,getZip,ggfreqScatter,ggplotlyr,GiniMd,Gompertz2,groupn,grType,hdquantile,hidingTOC,hist.data.frame,histbackback,histboxp,histboxpM,histSpike,histSpikeg,hoeffd,html,htmlGreek,htmlSN,htmlSpecial,htmlSpecialType,htmlTranslate,htmlVerbatim,importConvertDateTime,improveProb,impute,impute.transcan,inmChoice,inmChoicelike,intMarkovOrd,inverseFunction,invertTabulated,is.discrete,is.imputed,is.mChoice,is.present,is.special.miss,james.stein,jitter2,keepHattrib,Key,Key2,km.quick,knitrSet,labcurve,label,Label,labelLatex,labelPlotmath,Lag,largest.empty,latex,latexBuild,latexCheckOptions,latexDotchart,latexNeedle,latexSN,latexTabular,latexTherm,latexTranslate,latexVerbatim,list.tree,llist,lm.fit.qr.bare,Load,Lognorm2,logrank,lookupSASContents,lrcum,makeNames,makeNstr,makeSteps,mApply,markupSpecs,mask,match.mChoice,matchCases,matrix2dataFrame,matxv,mbarclPanel,mbarclpl,mChoice,mdb.get,Mean,medvPanel,medvpl,Merge,mgp.axis,mgp.axis.labels,mhgr,minor.tick,monotone,monthDays,mtitle,multEventChart,multLines,na.delete,na.detail.response,na.include,na.keep,na.pattern,na.retain,naclus,nafitted.delete,Names2names,naplot,napredict.delete,naprint.delete,naprint.keep,naresid.delete,naresid.keep,nFm,nmChoice,nobsY,nomiss,nstr,num.denom.setup,num.intercepts,numeric.string,numericScale,oPar,optionsCmds,ordGridFun,ordTestpo,outerText,pairUpDiff,panel.bpplot,panel.Dotplot,panel.Ecdf,panel.plsmo,panel.xYplot,parGrid,partition.matrix,partition.vector,pasteFit,pBlock,pc1,plotCorrM,plotCorrPrecision,plotp,plotlyM,plotlyParm,plotlySave,plotmathTranslate,plotMultSim,plotpsummaryM,plsmo,pngNeedle,pomodm,popower,posamsize,prepanel.Dotplot,prepanel.Ecdf,prepanel.xYplot,print.char.matrix,prList,prn,propsPO,propsTrans,prselect,prType,pstamp,putHcap,putHfig,putKey,putKeyEmpty,Quantile,Quantile2,R2Measures,rcorr,rcorr.cens,rcorrcens,rcorrp.cens,rcspline.eval,rcspline.plot,rcspline.restate,rcsplineFunction,read.xportDataload,readSAScsv,redun,reformM,reLabelled,replace.substring.wild,reShape,responseSummary,restoreHattrib,rlegend,rlegendg,rm.boot,rMultinom,roundN,roundPOSIXt,samplesize.bin,sas.codes,sas.get,sas.get.macro,sasdsLabels,sasxport.get,Save,scat1d,score.binary,sedit,sepUnitsTrans,setParNro,setTrellis,show.col,show.pch,showPsfrag,simMarkovOrd,simplifyDims,simPOcuts,simRegOrd,sKey,smean.cl.boot,smean.cl.normal,smean.sd,smean.sdl,smearingEst,smedian.hilow,solvet,somers2,soprobMarkovOrd,soprobMarkovOrdm,spearman,spearman.test,spearman2,spower,spss.get,src,stat_plsmo,stata.get,StatPlsmo,stepfun.eval,stratify,strgraphwrap,string.bounding.box,string.break.line,stringDims,stripChart,subplot,substi,substi.source,substring.location,substring2,summarize,summaryD,summaryDp,summaryM,summaryP,summaryRc,summaryS,symbol.freq,sys,t.test.cluster,table_formatpct,table_freq,table_latexdefs,table_N,table_pc,table_trio,tabulr,termsDrop,testDateTime,tex,tobase64image,transace,transcan,translate,trap.rule,trellis.strip.blank,truncPOSIXt,uncbind,units,unPaste,upData,upFirst,valueLabel,valueName,valueTags,valueUnit,var.inner,varclus,Weibull2,whichClosek,whichClosePW,whichClosest,wtd.Ecdf,wtd.loess.noiter,wtd.mean,wtd.quantile,wtd.rank,wtd.table,wtd.var,xInch,xless,xy.group,xYplot,xySortNoDupNoNA,yearDays,yInch,ynbind,zoom,"[<-.discrete","consolidate<-","is.na<-.discrete","label<-","length<-.discrete","substring2<-","valueLabel<-","valueName<-","valueTags<-","valueUnit<-")
11
22 useDynLib(Hmisc, .registration=TRUE, .fixes="F_")
33
0 Changes in version 4.7-1 (2022-08-13}
0 Changes in version 4.7-2 (2022-11-18)
1 * grType: changed to use find.package() instead of the slow installed.packages() (thanks: Uwe Ligges)
2 * latex.default: changed to by default omit the LaTeX comment; specify options(omitlatexcom=FALSE) to get original behavior
3 * ggplot.transcan: corrected color/color assignments; thanks: David Norris
4 * restoreHattrib: fixed to ignore attributes for variables that are not in obj
5 * popower: fixed URL for Live Free or Dichotomize
6 * getRs: improved to use rstudioapi to load the file into a script editor window
7 * mChoice: added ignoreNA argument and made new default behavior ignoreNA=TRUE unlike the prior versions; made value (appearing with semicolons) null instead of 0 when no choice was selected, which makes option add.none finally work
8 * mChoice: added condition argument to intersect all values instead of unioning them
9 * mChoicelike: new function like inmChoice but allowing matching on pieces of labels and optionally ignoring the case
10 * nmChoice: new function to compute the number of choices that were made per observation
11 * describe: fixed length > 1 problem with check for timeDate class
12 * Merge: better error message if unexpected variable from non-id-variable overlap
13 * all.is.numeric: corrected to return TRUE is the only non-NA values after converting to numeric were originally NA, addedd what='nonnum' argument
14
15 Changes in version 4.7-1 (2022-08-13)
116 * plot.describe: added bvspace argument to control spacing between categorical variables
217 * getRs: changed default put argument to 'source', changed RStudio code
318 * html.contents.data.frame: changed long space to &emsp; to render in more browser
9292 x <- M[[i]]
9393 ni <- nm[i]
9494 changed <- FALSE
95 if(ni %nin% names(lab))
96 stop(paste('Unexpected variable:', ni))
9597 if(lab[ni] != '' && ! length(attr(x, 'label'))) {
9698 label(x) <- lab[ni]
9799 changed <- TRUE
236236 res
237237 }
238238
239 all.is.numeric <- function(x, what=c('test','vector'),
239 all.is.numeric <- function(x, what=c('test','vector','nonnum'),
240240 extras=c('.','NA'))
241241 {
242242 what <- match.arg(what)
243243 x <- sub('[[:space:]]+$', '', x)
244244 x <- sub('^[[:space:]]+', '', x)
245 xs <- x[x %nin% c('',extras)]
246 if(! length(xs)) return(if(what == 'test') FALSE else x)
247 isnum <- suppressWarnings(!any(is.na(as.numeric(xs))))
248 if(what=='test')
249 isnum
250 else if(isnum)
251 as.numeric(x)
252 else x
245 xs <- x[x %nin% c('', extras)]
246 if(! length(xs) || all(is.na(x)))
247 return(switch(what, test = FALSE, vector=x, nonnum=x[0]))
248 isnon <- suppressWarnings(! is.na(xs) & is.na(as.numeric(xs)))
249 isnum <- ! any(isnon)
250 # suppressWarnings below handles extras present in x
251 switch(what,
252 test = isnum,
253 vector = if(isnum) suppressWarnings(as.numeric(x)) else x,
254 nonnum = xs[isnon])
253255 }
254256
255257 Lag <- function(x, shift=1)
16711673
16721674 if(localrepo) file.copy(paste(where, file, sel='/'), file)
16731675 else download.file.HTTPS(paste(where, file, sep='/'), file)
1674 file.edit(file)
1676 if(requireNamespace('rstudioapi', quietly=TRUE) &&
1677 rstudioapi::isAvailable()) rstudioapi::navigateToFile(file)
1678 else file.edit(file)
16751679 invisible()
16761680 }
16771681
18351839
18361840
18371841 grType <- function() {
1838 if('plotly' %nin% utils::installed.packages()[,1]) return('base')
1842 if(! length(find.package('plotly', quiet=TRUE))) return('base')
18391843 if(length(g <- .Options$grType) && g == 'plotly') 'plotly' else 'base'
18401844 }
18411845
19481952 }
19491953
19501954 restoreHattrib <- function(obj, attribs) {
1955 nam <- names(obj)
19511956 for(n in names(attribs)) {
19521957 a <- attribs[[n]]
19531958 if(length(a)) {
19541959 sv <- n == '.single.variable.'
1955 x <- if(sv) obj else obj[[n]]
1956 if(length(a$label)) label(x) <- a$label
1957 if(length(a$units)) units(x) <- a$units
1958 if(sv) return(x)
1959 obj[[n]] <- x
1960 if(sv || n %in% nam) {
1961 x <- if(sv) obj else obj[[n]]
1962 if(length(a$label)) label(x) <- a$label
1963 if(length(a$units)) units(x) <- a$units
1964 if(sv) return(x)
1965 obj[[n]] <- x
1966 }
19601967 }
19611968 }
19621969 obj
222222 if(n.unique >= 5) {
223223 loandhi <- x.unique[c(1 : 5, (n.unique - 4) : n.unique)]
224224 extremes <-
225 if(isdot && (class(loandhi) %nin% 'timeDate')) {
225 if(isdot && all(class(loandhi) %nin% 'timeDate')) {
226226 formatDateTime(unclass(loandhi), at=atx, roundDay=! timeUsed)
227227 } else if(isnum) loandhi else format(format(loandhi), ...)
228228 names(extremes) <- c("L1","L2","L3","L4","L5","H5","H4","H3","H2","H1")
568568
569569 ## pandoc used by R Markdown gets fooled by LaTeX comments
570570 olc <- getOption('omitlatexcom')
571 if(! length(olc) || ! olc)
571 if(length(olc) && olc)
572572 cat("%", deparse(sys.call()), "%\n", file=file, append=file != '', sep='')
573573
574574 if(dcolumn) {
0 # $Id$
10 mChoice <- function(..., label='',
21 sort.levels=c('original','alphabetic'),
3 add.none=FALSE, drop=TRUE)
2 add.none=FALSE, drop=TRUE, ignoreNA=TRUE)
43 {
54 sort.levels <- match.arg(sort.levels)
65 dotlist <- list(...)
87 if (drop)
98 lev <- unique(as.character(unlist(dotlist)))
109 else
11 lev <- unique(unlist(lapply(dotlist, function(x)levels(as.factor(x)))))
12
10 lev <- unique(unlist(lapply(dotlist, function(x) levels(as.factor(x)))))
11 if(ignoreNA) lev <- setdiff(lev, NA)
1312 if(sort.levels=='alphabetic') lev <- sort(lev)
1413
1514 lev <- setdiff(lev,'')
1615
1716 vcall <- as.character(sys.call())[-1]
18
19 dotlist <- lapply(dotlist, FUN=match, table=lev, nomatch=0)
20
17 dotlist <- lapply(dotlist, FUN=match, table=lev) #, nomatch=0)
18
2119 g <- function(...) {
2220 set <- c(...)
2321 set <- set[!is.na(set)]
24
2522 if(!length(set)) return('')
2623
2724 paste(sort(unique(set)), collapse=';')
154151 X
155152 }
156153
154 nmChoice <- function(object) {
155 y <- gsub('[^;]', '', object)
156 nchoices <- nchar(y) + 1
157 nchoices[object == ''] <- 0
158 nchoices
159 }
160
157161 summary.mChoice <- function(object, ncombos=5, minlength=NULL,
158162 drop=TRUE, ...) {
159163 nunique <- length(unique(object))
208212 # inmChoice <- function(x, values) {
209213 # match.mChoice(values, x, nomatch=0) > 0
210214 # }
211 inmChoice <- function(x, values) {
215 inmChoice <- function(x, values, condition=c('any', 'all')) {
216 condition <- match.arg(condition)
212217 lev <- attr(x, 'levels')
213218 if(is.character(values)) {
214219 v <- match(values, lev)
218223 }
219224 x <- paste(';', unclass(x), ';', sep='')
220225 values <- paste(';', values, ';', sep='')
221 res <- rep(FALSE, length(x))
226 res <- rep(condition != 'any', length(x))
222227 for(j in 1:length(values)) {
223228 i <- grep(values[j], x)
224 if(length(i)) res[i] <- TRUE
229 if(length(i)) {
230 if(condition == 'any') res[i] <- TRUE
231 else
232 res[-i] <- FALSE
233 } else if(condition == 'all') res[] <- FALSE
225234 }
226235 res
227236 }
228237
238 inmChoicelike <- function(x, values, condition=c('any', 'all'),
239 ignore.case=FALSE, fixed=FALSE) {
240 condition <- match.arg(condition)
241 if(! is.character(values)) stop('values must be a character vector')
242 x <- as.character(x)
243 res <- rep(condition != 'any', length(x))
244 for(j in 1 : length(values)) {
245 i <- grep(values[j], x, ignore.case=ignore.case, fixed=fixed)
246 if(length(i)) {
247 if(condition == 'any') res[i] <- TRUE
248 else
249 res[-i] <- FALSE
250 } else if(condition == 'all') res[] <- FALSE
251 }
252 res
253 }
254
255
229256 is.mChoice <- function(x) inherits(x, 'mChoice')
12871287 lab=lab, type='transform'))
12881288 }
12891289 }
1290
1291 # scale*manual calls are from David Norris
1292 # The implicit (alphabetical) order of 'imputed' and 'transform'
1293 # reverses the intended symbol & color assignments. But naming
1294 # the vectors corrects this.
1295
12901296 ggplot(data, aes(x=x, y=y, color=type, shape=type, size=type)) + geom_point() +
12911297 facet_wrap(~ X, scales=if(scale) 'free_x' else 'free', ...) +
12921298 xlab(NULL) + ylab('Transformed') +
1293 scale_color_manual(values=c('#00000059', '#FF000059')) +
1294 scale_shape_manual(values=c(1, 3)) +
1295 scale_size_manual(values=c(1.3, 2.25)) +
1299 scale_color_manual(values = c(transform="#00000059", imputed="#FF000059")) +
1300 scale_shape_manual(values = c(transform=1, imputed=3)) +
1301 scale_size_manual(values = c(transform=1.3, imputed=2.25)) +
12961302 theme(legend.position='none') +
12971303 geom_text(data=adata, aes(label=lab), parse=TRUE, size=1.65, col='black')
12981304 }
66 numeric vector. Leading and trailing blanks in \code{x} are ignored.
77 }
88 \usage{
9 all.is.numeric(x, what = c("test", "vector"), extras=c('.','NA'))
9 all.is.numeric(x, what = c("test", "vector", "nonnum"), extras=c('.','NA'))
1010 }
1111 \arguments{
1212 \item{x}{a character vector}
1313 \item{what}{specify \code{what="vector"} to return a numeric vector if
14 it passes the test, or the original character vector otherwise}
14 it passes the test, or the original character vector otherwise, the
15 default \code{"test"} to return \code{FALSE} if there are no
16 non-missing non-\code{extra} values of \code{x} or there is at least
17 one non-numeric value of \code{x}, or \code{"nonnum"} to return the
18 vector of non-\code{extra}, non-NA, non-numeric values of \code{x}.}
1519 \item{extras}{a vector of character strings to count as numeric
1620 values, other than \code{""}.}
1721 }
2428 all.is.numeric(c('1','1.2','3'),'vector')
2529 all.is.numeric(c('1','1.2','3a'),'vector')
2630 all.is.numeric(c('1','',' .'),'vector')
31 all.is.numeric(c('1', '1.2', '3a'), 'nonnum')
2732 }
2833 \keyword{character}
3535 minor categories available. Specify a character string to list
3636 all scripts whose major category contains the string (ignoring
3737 case).}
38 \item{put}{Leave at the default (\code{'rstudio'}) to load \code{file}
39 into the RStudio script editor window. Use \code{put='source'} to
40 \code{source()} the file. This is useful when the file just defines
41 a function you want to use in the session.}
38 \item{put}{Leave at the default (\code{'source'}) to \code{source()} the file. This is useful when the file just defines a function you want to use in the session. Use load \code{put='rstudio'} to load the file into the RStudio script editor window using the \code{rstudioapi} \code{navigateToFile} function. If RStudio is not running, \code{file.edit()} is used instead.}
4239 }
4340 \value{a data frame or list, depending on arguments}
4441 \author{Frank Harrell and Cole Beck}
4545 \details{
4646 \code{hidingTOC} creates a table of contents in a Rmd document that
4747 can be hidden at the press of a button. It also generate buttons that allow
48 the hiding or unhiding of the diffrent level depths of the table of contents.
48 the hiding or unhiding of the diffrent level depths of the table of
49 contents. For \code{quarto}-related methods see \url{https://stackoverflow.com/questions/73999697}.
4950 }
5051 \examples{
5152 \dontrun{
547547 commands which are assumed to be in the system path.
548548 }
549549 \details{
550 \command{latex.default} outputs a LaTeX comment containing the calling
551 statement. To suppress outputting this comment, run
552 \command{options(omitlatexcom=TRUE)} before running. This is helpful
550 \command{latex.default} optionally outputs a LaTeX comment containing the calling
551 statement. To output this comment, run
552 \command{options(omitlatexcom=FALSE)} before running. The default behavior or suppressing the comment is helpful
553553 when running RMarkdown to produce pdf output using LaTeX, as this uses
554554 \command{pandoc} which is fooled into try to escape the percent
555555 comment symbol.
55 \alias{as.character.mChoice}
66 \alias{as.double.mChoice}
77 \alias{inmChoice}
8 \alias{inmChoicelike}
9 \alias{nmChoice}
810 \alias{match.mChoice}
911 \alias{[.mChoice}
1012 \alias{print.summary.mChoice}
4951 contains at least one of the codes or value labels in the second
5052 argument.
5153
52 \code{match.mChoice} creats an integer vector of the indexes of all
54 \code{match.mChoice} creates an integer vector of the indexes of all
5355 elements in \code{table} which contain any of the speicified levels
56
57 \code{nmChoice} returns an integer vector of the number of choices
58 that were made
5459
5560 \code{is.mChoice} returns \code{TRUE} is the argument is a multiple
5661 choice variable.
5863 \usage{
5964 mChoice(\dots, label='',
6065 sort.levels=c('original','alphabetic'),
61 add.none=FALSE, drop=TRUE)
66 add.none=FALSE, drop=TRUE, ignoreNA=TRUE)
6267
6368 \method{format}{mChoice}(x, minlength=NULL, sep=";", \dots)
6469
7782
7883 match.mChoice(x, table, nomatch=NA, incomparables=FALSE)
7984
80 inmChoice(x, values)
85 inmChoice(x, values, condition=c('any', 'all'))
86
87 inmChoicelike(x, values, condition=c('any', 'all'),
88 ignore.case=FALSE, fixed=FALSE)
89
90 nmChoice(object)
8191
8292 is.mChoice(x)
8393
119129 set \code{drop=FALSE} to keep unused factor levels as columns of the matrix
120130 produced by \code{mChoice}
121131 }
132 \item{ignoreNA}{set to \code{FALSE} to keep any \code{NA}s present in
133 data as a real level. Prior to Hmisc 4.7-2 \code{FALSE} was the default.}
122134 \item{x}{
123135 an object of class \code{"mchoice"} such as that created by
124136 \code{mChoice}. For \code{is.mChoice} is any object.
153165 \item{values}{
154166 a scalar or vector. If \code{values} is integer, it is
155167 the choice codes, and if it is a character vector, it is assumed to
156 be value labels.
157 }
168 be value labels. For \code{inmChoicelike} \code{values} must be
169 character strings which are pieces of choice labels.
170 }
171 \item{condition}{set to \code{'all'} for \code{inmChoice} to require
172 that all choices in \code{values} be present instead of the default of
173 any of them present.}
174 \item{ignore.case}{set to \code{TRUE} to have \code{inmChoicelike}
175 ignore case in the data when matching on \code{values}}
176 \item{fixed}{see \code{grep}}
158177 }
159178 \value{
160179 \code{mChoice} returns a character vector of class \code{"mChoice"}
161180 plus attributes \code{"levels"} and \code{"label"}.
162181 \code{summary.mChoice} returns an object of class
163 \code{"summary.mChoice"}. \code{inmChoice} returns a logical vector.
182 \code{"summary.mChoice"}. \code{inmChoice} and \code{inmChoicelike}
183 return a logical vector.
164184 \code{format.mChoice} returns a character vector, and
165185 \code{as.double.mChoice} returns a binary numeric matrix.
186 \code{nmChoice} returns an integer vector
166187 }
167188 \author{
168189 Frank Harrell
197218 print(Symptoms, long=TRUE)
198219 format(Symptoms[1:5])
199220 inmChoice(Symptoms,'Headache')
221 inmChoicelike(Symptoms, 'head', ignore.case=TRUE)
200222 levels(Symptoms)
201223 inmChoice(Symptoms, 3)
224 # Find all subjects with either of two symptoms
202225 inmChoice(Symptoms, c('Headache','Hangnail'))
203226 # Note: In this example, some subjects have the same symptom checked
204227 # multiple times; in practice these redundant selections would be NAs
205228 # mChoice will ignore these redundant selections
229 # Find all subjects with both symptoms
230 inmChoice(Symptoms, c('Headache', 'Hangnail'), condition='all')
206231
207232 meanage <- N <- numeric(5)
208233 for(j in 1:5) {
4141
4242 \code{multEventChart} uses \code{\link{ggplot2}} to plot event charts
4343 showing state transitions, account for absorbing states/events. It is
44 based on code written by Lucy D'Agostino McGowan posted at \url{https://livefreeordichotomize.com/2020/05/21/survival-model-detective-1}.
44 based on code written by Lucy D'Agostino McGowan posted at \url{https://livefreeordichotomize.com/posts/2020-05-21-survival-model-detective-1/}.
4545
4646 }
4747 \usage{
00 #include "R.h"
11
2 void sort2(np,ra,rb)
3 int *np;
4 double ra[];
5 int rb[];
2 void sort2(int *np, double ra[], int rb[])
63 {
74 int l,j,ir,i,n,rrb,*xrb;
85 double rra,*xra;
4542 }
4643
4744
48 void crank(np, w)
49 int *np;
50 double w[];
51
45 void crank(int *np, double w[])
5246 {
5347 int n,j=1,ji,jt;
5448 double rank,*xw;
7266 }
7367
7468
75 void F77_SUB(rank)(np, x, w, ix, r)
76 int *np, ix[];
77 double x[],r[],w[];
78
69 void F77_SUB(rank)(int *np, double x[], double w[], int ix[], double r[])
7970 {
8071 int n, *xix, i;
8172 double *xx, *xr, *xw;