31 Date 20111226 Author TszKin Julian Chan Maintainer TszKin Julian Chan Description Some handy function in R License GPL 2 LazyLoad yes Suggests testthat BugReports TszKin Julian Chan NeedsCompilation no Repository CRAN DatePublication 20140307 082 ID: 75362
Download Pdf The PPT/PDF document "Package Jmisc February Type Package Ti..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
2demeanIndex13 addColAddaconstantcolumntoadata.frameormatrix DescriptionAddaconstantcolumntodata.frameormatrix.UsageaddCol(x,...,value)Argumentsxdata.frameormatrix...constantsvaluevectoravectorofconstantsValueadata.frameormatrixcontainsallcolumnsinxandthoseconstantcolumns.Author(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;Examplesd=data.frame(x=1:5,y=11:15)addCol(d,a=1,b=2,c=3)addCol(d,value=c(a=100,b=200,c=300)) demeanDemeanavectororamatrix(bycolumn) DescriptionDemeanavectororamatrix(bycolumn)Usagedemean(x)ArgumentsxVectorormatrix 4JBTest generateSignificanceGeneratet-statistics,p-valueandsignicance DescriptionGeneratet-statistics,p-valueandsignicancefromestimatesanditssd.EstimatesanditsSDistherstandsecondcolumnrespectivelyUsagegenerateSignificance(x,row_names)ArgumentsxAmatrixordata.framerow_namesnamesofrowValueadata.frameAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;Examplesnx_data(()())x_estimates(()()())generateSignificance(x_estimates)generateSignificance(x_estimates,row_names=c("mean0","mean1")) JBTestpValueofJarqueBeratest DescriptionReturnthepValueofJarqueBeratest.TheJarqueBeratesttestthenullhypothesisthatthedataarefromanormaldistribution.UsageJBTest(x) label_both_parsed_recode5ArgumentsxdataValuepValueofJarqueBeratestAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;ExamplesJBTest(rnorm(50))JBTest(rt(50,3))n=100#sizemean(replicate(n,JBTest(rnorm(100))))#powermean(replicate(n,JBTest(rt(100,3)))) label_both_parsed_recodeCombinelabel_bothandlabel_parsedinggplot2. DescriptionCombinelabel_bothandlabel_parsedinggplot2.Alsoaddedarenamefunctiontoitseelabel_bothandlabel_parsedinggplot2fordetails.Usagelabel_both_parsed_recode(display_name)Argumentsdisplay_nameAvectorcontainsthedisplayname.Namesofthevectoraretheoriginalname.ValueAfunctionsimilartolabel_bothandlabel_parsedinggplot2fordetails.Author(s)TszKinJulianChantsz;kin@;gmai;l.co;m000; packages7 packagesloadpackageswithauto-installation Descriptionloadadd-onpackages.Ifthepackagescannotbefound,install.packagesiscalled.Usagepackages(x,...)Argumentsxnameofthepackages...argumentstoinstall.packagesAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;SeeAlsorequireinstall.packagesExamples##Notrun:packages("foreach")##End(Notrun) recodeRecodethevalueofavector DescriptionRecodethevalueofavectorormatrix.Usagerecode(x,from,to)Argumentsxavectorormatrixfromoriginalvalueofxtonewvalueofx repRow9 repRowRepeatavectorbyrow DescriptionRepeatavectorbyrowUsagerepRow(x,n)ArgumentsxvectorormatrixnnumberofreplicationAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;SeeAlsorepColExamplesrepRow(c(a=1,b=2,c=3),5)repCol(c(a=1,b=2,c=3),5) shiftshiftavectorbyshift_byunit DescriptionRepeatavectorbyrowUsageshift(x,shift_by)Argumentsxavectorshift_bynumberofshift splitBy11 splitBySplitavectorbyasequenceoflength DescriptionSplitavectorbyasequenceoflengthThisfunctionwillsplitthevectorxintolength(x)subvector.Thelengthofeachsubvectorisgivenbyby.UsagesplitBy(x,by)ArgumentsxAvectortobesplittedbyAvectoroflengthValuealistofsubvectorAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;ExamplessplitBy((1:10)*10,c(2,2))splitBy((1:10)*10,c(2,3,4))##Notrun:expect_equivalent(splitBy((1:10)*10,c(2,2)),list(c(10,20),c(30,40)))expect_equivalent(splitBy((1:10)*10,c(2,3,4)),list(c(10,20),c(30,40,50),c(60,70,80,90)))##End(Notrun) ticStartStopclocktomeasureperformance DescriptionStart/clocktomeasureperformance.SameasticandtocinmatlabUsagetic(name=".time_Jmisc",envir=.GlobalEnv)toc() 12%+%ArgumentsnameNameofthetemporarytimevariableenvirenvironmentofthetemporarytimevariableAuthor(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;Examples##Notrun:tic()Sys.sleep(1)toc##End(Notrun) %+%Concatenatetwostrings DescriptionPastetwostringstogetherwithoutseparation.Usages1%+%s2Argumentss1FirstStrings2SecondStringValuepaste(s1,s2,sep="")Author(s)TszKinJulianChantsz;kin@;gmai;l.co;m000;Examplescat("Hello"%+%"World")