Description Usage

合集下载

iOS隐私权限和通过openURL实现跳转实例

iOS隐私权限和通过openURL实现跳转实例

iOS隐私权限和通过openURL实现跳转实例iOS 10之后苹果对于⽤户隐私⽅⾯要求⾮常严格,曾经帮朋友发布纯H5的APP,由于使⽤第三⽅⽽未加隐私权限都不让提交App Store。

这边就是给⼤家列举下苹果对于最为常见的隐私以及平时我们开发是会⽤到的openUrl这⽅法所⽤到的key。

⼀、隐私权限当然有朋友会说,不加隐私,让他奔溃后再log中找就好了,通常会导致奔溃的可以这样做,但是例如定位什么的就不会产⽣奔溃,直接是定位不出结果的,这时候就需要⾃⼰拼写了。

<key>NSPhotoLibraryUsageDescription</key><string>访问相册</string><key>NSCameraUsageDescription</key><string>访问相机</string><key>NSContactsUsageDescription</key><string>访问通讯录</string><key>NSMicrophoneUsageDescription</key><string>访问麦克风</string><key>NSAppleMusicUsageDescription</key><string>访问媒体资料库</string><key>NSLocationUsageDescription</key><string>访问位置</string><key>NSLocationWhenInUseUsageDescription</key><string>使⽤期间访问位置</string><key>NSLocationAlwaysUsageDescription</key><string>始终访问位置</string><key>NSCalendarsUsageDescription</key><string>访问⽇历</string><key>NSRemindersUsageDescription</key><string>访问提醒事项</string><key>NSMotionUsageDescription</key><string>访问运动与健⾝</string><key>NSHealthUpdateUsageDescription</key><string>访问健康更新 </string><key>NSHealthShareUsageDescription</key><string>访问健康分享</string><key>NSBluetoothPeripheralUsageDescription</key><string>访问蓝⽛</string><key>NSSiriUsageDescription</key><string>访问Siri</string><key>NSSpeechRecognitionUsageDescription</key><string>访问语⾳识别</string>以上只是列举了⽐较常见的。

o2plsda软件包说明书

o2plsda软件包说明书

Package‘o2plsda’October14,2022Type PackageTitle Multiomics Data IntegrationVersion0.0.18Description Provides functions to do'O2PLS-DA'analysis for multiple omics data integration.The algorithm came from``O2-PLS,a two-block(X±Y)latent variable regression(LVR)method with an integral OSCfilter''which published by Johan Trygg and Svante Wold at2003<doi:10.1002/cem.775>.'O2PLS'is a bidirectional multivariate regression method that aims to separate the covariance be-tweentwo data sets(it was recently extended to multiple data sets)(Löfst-edt and Trygg,2011<doi:10.1002/cem.1388>;Löfst-edt et al.,2012<doi:10.1016/j.aca.2013.06.026>)from the systematic sources of variance being specific for each data set separately.License GPL-3Imports Rcpp(>=1.0.7),dplyr,magrittr,parallel,ggplot2,ggrepel,methods,statsDependsEncoding UTF-8Suggests knitr,markdown,rmarkdownVignetteBuilder knitrLinkingTo Rcpp,RcppArmadilloRoxygenNote7.1.2NeedsCompilation yesRepository CRANAuthor Kai Guo[aut,cre],Junguk Hur[aut],Eva Feldman[aut]Maintainer Kai Guo<*****************>Date/Publication2022-08-1207:10:02UTC12loadings R topics documented:loadings (2)loadings.o2plsda (3)loadings.plsda (3)o2cv (4)o2pls (5)O2pls-class (7)oplsda (7)plot.O2pls (8)plot.o2plsda (10)plot.plsda (11)plsda (12)print.O2pls (14)print.plsda (14)scores (15)scores.O2pls (15)scores.o2plsda (16)scores.plsda (16)summary.O2pls (17)summary.plsda (18)vip (18)Index20 loadings Extract the loadings from an O2PLSfitDescriptionThis function extracts loading parameters from an O2PLSfitThis function extracts loading parameters from an O2PLSfitUsageloadings(x,...)##S3method for class O2plsloadings(x,loading=c("Xjoint","Yjoint","Xorth","Yorth"),...)Argumentsx Object of class O2pls...For consistencyloading the loadings for one of"Xjoint","Yjoint","Xorth","Yorth"loadings.o2plsda3 ValueLoading matrixLoading matrixloadings.o2plsda extract the loading value from the O2PLSDA analysisDescriptionextract the loading value from the O2PLSDA analysisUsage##S3method for class o2plsdaloadings(x,loading="Xloading",...)Argumentsx Object of class o2plsdaloading the loadings for one of"Xjoint","Yjoint","Xorth","Yorth"...For consistencyloadings.plsda extract the loading value from the PLSDA analysisDescriptionextract the loading value from the PLSDA analysisUsage##S3method for class plsdaloadings(x,...)Argumentsx Object of class plsda...For consistency4o2cv o2cv Cross validation for O2PLSDescriptionCross validation for O2PLSUsageo2cv(X,Y,nc,nx,ny,group=NULL,nr_folds=5,ncores=1,scale=FALSE,center=FALSE)ArgumentsX a Numeric matrix(input)Y a Numeric matrix(input)nc Integer.Number of joint PLS components.nx Integer.Number of orthogonal components in Xny Integer.Number of orthogonal components in Ygroup a vector to indicate the group for Ynr_folds Integer to indicate the folds for cross validationncores Integer.Number of CPUs to use for cross validationscale boolean values determining if data should be scaled or notcenter boolean values determining if data should be centered or notValuea data frame with the Q and RMSE valuesAuthor(s)Kai GuoExamplesset.seed(123)X=matrix(rnorm(500),50,10)Y=matrix(rnorm(500),50,10)X=scale(X,scale=TRUE)Y=scale(Y,scale=TRUE)#group factor could be omitted if you don t have any groupgroup<-rep(c("Ctrl","Treat"),each=25)cv<-o2cv(X,Y,1:2,1:2,1:2,group=group,nr_folds=2,ncores=1)o2plsfit O2PLS model with best nc,nx,nyDescriptionfit O2PLS model with best nc,nx,nyUsageo2pls(X,Y,nc,nx,ny,scale=FALSE,center=FALSE) ArgumentsX a Numeric matrix(input)Y a Numeric matrix(input)nc Integer.Number of joint PLS components.nx Integer.Number of orthogonal components in Xny Integer.Number of orthogonal components in Yscale boolean values determining if data should be scaled or not center boolean values determining if data should be centered or not ValueAn object containingXscore Joint X scoresXloading Joint X loadingsYscore Joint Y scoresYloading Joint Y loadingsTYosc Orthogonal X scoresPYosc Orthogonal X loadingsWYosc Orthogonal X weightsUXosc Orthogonal Y scoresPXosc Orthogonal Y loadingsCXosc Orthogonal Y weightsBU Regression coefficient in Tt~UBT Regression coefficient in U~TtR2Xhat Prediction of X with YR2Yhat Prediction of Y with XR2X Variation of the modeled part in X(defined by Joint+Orthogonal variation)as proportion of total variation in XR2Y Variation of the modeled part in Y(defined by Joint+Orthogonal variation)as proportion of total variation in YR2Xcorr Variation of the joint part in XR2Ycorr Variation of the joint part in YR2Xo Variation of the orthogonal part in X as proportion of variation in XR2Yo Variation of the orthogonal part in Y as proportion of variation in YR2Xp Variation in X joint part predicted by Y Joint partR2Yp Variation in Y joint part predicted by X Joint partvarXj Variation in each Latent Variable(LV)in X Joint partvarYj Variation in each Latent Variable(LV)in Y Joint partvarXorth Variation in each Latent Variable(LV)in X Orthogonal partvarYorth Variation in each Latent Variable(LV)in Y Orthogonal partExy Residuals in XFxy Residuals in YAuthor(s)Kai GuoExamplesset.seed(123)X=matrix(rnorm(500),50,10)Y=matrix(rnorm(500),50,10)X=scale(X,scale=TRUE)Y=scale(Y,scale=TRUE)fit<-o2pls(X,Y,1,2,2)summary(fit)O2pls-class7 O2pls-class Class"O2pls"This class represents the Annotation informationDescriptionClass"O2pls"This class represents the Annotation informationSlotsX a Numeric matrix(input)Y a Numeric matrix(input)params paramaters ysed in o2pls analysisresults list of o2pls resultsAuthor(s)Kai Guooplsda Orthogonal partial least squares discriminant analysisDescriptionComputes orthogonal scores partial least squares regressions with the NIPALS algorithm.It returna comprehensive set of pls outputs(e.g.scores and vip).Usageoplsda(X,Y,nc,scale=FALSE,center=TRUE,maxiter=100,tol=1e-05)ArgumentsX a O2pls object or a matrix of predictor variables.Y a single vector indicate the groupnc the number of pls components(the one joint components+number of orthogo-nal components).scale logical indicating whether X must be scaled(suggest TRUE).center boolean values determining if data should be centered or notmaxiter maximum number of iterations.tol limit for convergence of the algorithm in the nipals algorithm.Valuea list containing the following elements:•nc the number of components used(one joint components+number of orthogonal components •scores a matrix of scores corresponding to the observations in X,The components retrieved correspond to the ones optimized or specified.•Xloadings a matrix of loadings corresponding to the explanatory variables.The components retrieved correspond to the ones optimized or specified.•Yloadings a matrix of partial least squares loadings corresponding to Y•vip the VIP matrix.•xvar a matrix indicating the standard deviation of each component(sd),the variance ex-plained by each single component(explained_var)and the cumulative explained variance(cu-mulative_explained_var).These values are computed based on the data used to create the projection matrices.•projection_matrix the matrix of projection matrix•weight a matrix of partial least squares("pls")weights.Author(s)Kai GuoExamplesX<-matrix(rnorm(50),10,5)Y<-matrix(rnorm(50),10,5)fit<-o2pls(X,Y,2,1,1)yy<-rep(c(0,1),5)fit0<-oplsda(fit,yy,2)plot.O2pls Score or loading plot for the O2PLS resultsDescriptionScore or loading plot for the O2PLS resultsUsage##S3method for class O2plsplot(x,type="score",var="Xjoint",group=NULL,ind=c(1,2),color=NULL,top=20,ellipse=TRUE,order=FALSE,pt.size=3,label=TRUE,label.size=4,repel=TRUE,rotation=FALSE,...)Argumentsx an O2pls objecttype score or loadingvar specify Xjointgroup color used for score plotind which components to be used for score plot or loading plot color color used for score or loading plottop the number of largest loading value to plotellipse TRUE/FALSEorder order by the value or notpt.size point sizelabel plot label or not(TRUE/FALSE)label.size label sizerepel use ggrepel to show the label or notrotationflip thefigure or not(TRUE/FALSE)...For consistencyValuea ggplot2objectAuthor(s)Kai GuoExamplesX<-matrix(rnorm(50),10,5)Y<-matrix(rnorm(50),10,5)fit<-o2pls(X,Y,2,1,1)plot(fit,type="score")plot.o2plsda Score,VIP or loading plot for the O2PLS resultsDescriptionScore,VIP or loading plot for the O2PLS resultsUsage##S3method for class o2plsdaplot(x,type="score",var="Xjoint",group=NULL,ind=c(1,2),color=NULL,top=20,ellipse=TRUE,order=FALSE,pt.size=3,label=TRUE,label.size=4,repel=FALSE,rotation=FALSE,...)Argumentsx an o2plsda objecttype score,vip or loadingvar specify Xjointgroup color used for score plotind which components to be used for score plot or loading plot color color used for score or loading plottop the number of largest loading value to plotellipse TRUE/FALSEorder order by the value or notpt.size point sizelabel plot label or not(TRUE/FALSE)label.size label sizerepel use ggrepel to show the label or notrotationflip thefigure or not(TRUE/FALSE)...For consistencyplot.plsda11 Valuea ggplot2objectAuthor(s)Kai GuoExamplesX<-matrix(rnorm(50),10,5)Y<-matrix(rnorm(50),10,5)fit<-o2pls(X,Y,2,1,1)yy<-rep(c(0,1),5)fit0<-oplsda(fit,yy,2)plot(fit0,type="score",group=factor(yy))plot.plsda Score,VIP or loading plot for the plsda resultsDescriptionScore,VIP or loading plot for the plsda resultsUsage##S3method for class plsdaplot(x,type="score",group=NULL,ind=c(1,2),color=NULL,top=20,ellipse=TRUE,order=FALSE,pt.size=3,label=TRUE,label.size=4,repel=FALSE,rotation=FALSE,...)Argumentsx an plsda objecttype score,vip or loadinggroup color used for score plotind which components to be used for score plot or loading plotcolor color used for score or loading plottop the number of largest loading value to plotellipse TRUE/FALSEorder order by the value or notpt.size point sizelabel plot label or not(TRUE/FALSE)label.size label sizerepel use ggrepel to show the label or notrotationflip thefigure or not(TRUE/FALSE)...For consistencyValuea ggplot2objectAuthor(s)Kai GuoExamplesX<-matrix(rnorm(500),10,50)Y<-rep(c("a","b"),each=5)fit0<-plsda(X,Y,2)plot(fit0,type="score",group=factor(Y))plsda Partial least squares discriminant analysisDescriptionPerform a PLS discriminant analysisUsageplsda(X,Y,nc,scale=TRUE,center=TRUE,cv=TRUE,nr_folds=5)ArgumentsX a matrix of predictor variables.Y a single vector indicate the groupnc the number of pls components(the one joint components+number of orthogo-nal components).scale logical indicating whether X must be scaled(suggest TRUE).center logical indicating whether X must be centered(suggest TRUE).cv logical indicating whether cross-validation will be performed or not(suggest TRUE).nr_folds nr_folds Integer to indicate the folds for cross validation.Valuea list containing the following elements:•nc the number of components used(one joint components+number of orthogonal components •scores a matrix of scores corresponding to the observations in X,The components retrieved correspond to the ones optimized or specified.•Xloadings a matrix of loadings corresponding to the explanatory variables.The components retrieved correspond to the ones optimized or specified.•vip the VIP matrix.•xvar variance explained of X by each single component.•R2Y variance explained of Y by each single component.•codePRESSThe residual sum of squares for the samples which were not used tofit the model •codeQ2quality of cross-validationAuthor(s)Kai GuoExamplesX<-matrix(rnorm(500),10,50)Y<-rep(c("a","b"),each=5)fit<-plsda(X,Y,2)14print.plsda print.O2pls Print the summary of O2PLS results.DescriptionPrint the summary of O2PLS results.Usage##S3method for class O2plsprint(x,...)Argumentsx An O2pls object...For consistencyAuthor(s)Kai GuoExamplesX<-matrix(rnorm(50),10,5)Y<-matrix(rnorm(50),10,5)object<-o2pls(X,Y,1,1,1)print(object)print.plsda Print the summary of plsda results.DescriptionPrint the summary of plsda results.Usage##S3method for class plsdaprint(x,...)Argumentsx An plsda object...For consistencyscores15Author(s)Kai GuoExamplesX<-matrix(rnorm(500),10,50)Y<-rep(c("a","b"),each=5)fit<-plsda(X,Y,2)print(fit)scores Extract the scores from an O2PLSfitDescriptionThis function extracts score matrices from an O2PLSfitUsagescores(x,...)Argumentsx Object of class O2pls...For consistencyValueScores matrixscores.O2pls Extract the scores from an O2PLSfitDescriptionThis function extracts scores parameters from an O2PLSfitUsage##S3method for class O2plsscores(x,score=c("Xjoint","Yjoint","Xorth","Yorth"),...)Argumentsx Object of class O2plsscore the scores matrix for one of"Xjoint","Yjoint","Xorth","Yorth"...Other arguments16scores.plsdaValuescore matrixscores.o2plsda Extract the scores from an O2PLS DA analysisDescriptionExtract the scores from an O2PLS DA analysisUsage##S3method for class o2plsdascores(x,...)Argumentsx Object of class o2plsda...Other argumentsValuescore matrixAuthor(s)Kai Guoscores.plsda Extract the scores PLSDA analysisDescriptionExtract the scores PLSDA analysisUsage##S3method for class plsdascores(x,...)Argumentsx Object of class plsda...Other argumentssummary.O2pls17 Valuescore matrixAuthor(s)Kai Guosummary.O2pls Summary of an O2PLS objectDescriptionSummary of an O2PLS objectUsage##S3method for class O2plssummary(object,...)Argumentsobject a O2pls object...For consistencyValueDetail of O2PLS resultsAuthor(s)Kai GuoExamplesX<-matrix(rnorm(50),10,5)Y<-matrix(rnorm(50),10,5)object<-o2pls(X,Y,1,1,1)summary(object)18vip summary.plsda Summary of an plsda objectDescriptionSummary of an plsda objectUsage##S3method for class plsdasummary(object,...)Argumentsobject a plsda object...For consistencyValueDetail of plsda resultsAuthor(s)Kai GuoExamplesX<-matrix(rnorm(500),10,50)Y<-rep(c("a","b"),each=5)fit<-plsda(X,Y,2)summary(fit)vip Extract the VIP values from the O2PLS-DA objectDescriptionExtract the VIP values from the O2PLS-DA objectUsagevip(x)Argumentsx the o2plsda object or plsda objectvip19Valuea data frameIndex∗classesO2pls-class,7loadings,2loadings.o2plsda,3loadings.plsda,3o2cv,4o2pls,5O2pls-class,7oplsda,7plot.O2pls,8plot.o2plsda,10plot.plsda,11plsda,12print.O2pls,14print.plsda,14scores,15scores.O2pls,15scores.o2plsda,16scores.plsda,16summary.O2pls,17summary.plsda,18vip,1820。

rSAFE包说明说明书

rSAFE包说明说明书

Package‘rSAFE’October14,2022Title Surrogate-Assisted Feature ExtractionVersion0.1.4DescriptionProvides a model agnostic tool for white-box model trained on features extracted from a black-box model.For more information see:Gosiewska et al.(2020)<doi:10.1016/j.dss.2021.113556>. Depends R(>=3.5.0)License GPL-3Encoding UTF-8LazyData trueRoxygenNote7.2.1Imports DALEX,dendextend,ggplot2,ggpubr,grDevices,ingredients,sets,statsSuggests gbm,knitr,pander,randomForest,rmarkdown,spelling,testthat,vdiffrVignetteBuilder knitrURL https:///ModelOriented/rSAFEBugReports https:///ModelOriented/rSAFE/issuesLanguage en-USNeedsCompilation noAuthor Alicja Gosiewska[aut,cre],Anna Gierlak[aut],Przemyslaw Biecek[aut,ths],Michal Burdukiewicz[ctb](<https:///0000-0001-8926-582X>)Maintainer Alicja Gosiewska<*************************>Repository CRANDate/Publication2022-08-1313:20:02UTC12apartments R topics documented:apartments (2)HR_data (3)plot.safe_extractor (3)print.safe_extractor (4)safely_detect_changepoints (5)safely_detect_interactions (6)safely_select_variables (7)safely_transform_categorical (8)safely_transform_continuous (9)safely_transform_data (11)safe_extraction (12)Index14 apartments Apartments dataDescriptionDatasets apartments and apartmentsTest are artificial,generated from the same model.Structure of the dataset is copied from real dataset from PBImisc package,but they were generated in a way to mimic effect of Anscombe quartet for complex black box models.Usagedata(apartments)Formata data frame with1000rows and6columnsDetails•m2.price-price per square meter•surface-apartment area in square meters•no.rooms-number of rooms(correlated with surface)•district-district in which apartment is located,factor with10levels(Bemowo,Bielany,Moko-tow,Ochota,Praga,Srodmiescie,Ursus,Ursynow,Wola,Zoliborz)•floor-floor•construction.year-construction yearHR_data3HR_data Why are our best and most experienced employees leaving prema-turely?DescriptionA dataset from Kaggle competition Human Resources Analytics.https:/// FormatA data frame with14999rows and10variablesDetails•satisfaction_level Level of satisfaction(0-1)•last_evaluation Time since last performance evaluation(in Years)•number_project Number of projects completed while at work•average_monthly_hours Average monthly hours at workplace•time_spend_company Number of years spent in the company•work_accident Whether the employee had a workplace accident•left Whether the employee left the workplace or not(1or0)Factor•promotion_last_5years Whether the employee was promoted in the lastfive years•sales Department in which they work for•salary Relative level of salary(high)SourceDataset HR-analytics from https://plot.safe_extractor Plotting Transformations of the SAFE Extractor ObjectDescriptionPlotting Transformations of the SAFE Extractor ObjectUsage##S3method for class safe_extractorplot(x,...,variable=NULL)4print.safe_extractor Argumentsx safe_extractor object containing information about variables transformations cre-ated with safe_extraction()function...other parametersvariable character,name of the variable to be plottedValuea plot objectprint.safe_extractor Printing Summary of the SAFE Extractor ObjectDescriptionPrinting Summary of the SAFE Extractor ObjectUsage##S3method for class safe_extractorprint(x,...,variable=NULL)Argumentsx safe_extractor object containing information about variables transformations cre-ated with safe_extraction()function...other parametersvariable character,name of the variable to be plotted.If this argument is not specified then transformations for all variables are printedValueNo return value,prints the structure of the objectsafely_detect_changepoints5 safely_detect_changepointsIdentifying Changes in a Series Using PELT AlgorithmDescriptionThe safely_detect_changepoints()function calculates the optimal positioning and number of change-points for given data and penalty.It uses a PELT algorithm with a nonparametric cost function based on the empirical distribution.The implementation is inspired by the code available on https:///rkillick/changepoint.Usagesafely_detect_changepoints(data,penalty="MBIC",nquantiles=10)Argumentsdata a vector within which you wish tofind changepointspenalty penalty for introducing another changepoint,one of"AIC","BIC","SIC","MBIC", "Hannan-Quinn"or numeric non-negative valuenquantiles the number of quantiles used in integral approximationValuea vector of optimal changepoint positions(last observations of each segment)See Alsosafely_transform_continuousExampleslibrary(rSAFE)data<-rep(c(2,7),each=4)safely_detect_changepoints(data)set.seed(123)data<-c(rnorm(15,0),rnorm(20,2),rnorm(30,8))safely_detect_changepoints(data)safely_detect_changepoints(data,penalty=25)6safely_detect_interactions safely_detect_interactionsDetecting Interactions via Permutation ApproachDescriptionThe safely_detect_interactions()function detects second-order interactions based on predictions made by a surrogate model.For each pair of features it performs values permutation in order to evaluate their non_additive effect.Usagesafely_detect_interactions(explainer,inter_param=0.5,inter_threshold=0.5,verbose=TRUE)Argumentsexplainer DALEX explainer created with explain()functioninter_param numeric,a positive value indicating which of single observation non-additive effects are to be regarded as significant,the higher value the higher non-additiveeffect has to be to be taken into accountinter_thresholdnumeric,a value from[0,1]interval indicating which interactions should be re-turned as significant.It corresponds to the percentage of observations for whichinteraction measure is greater than inter_param-if this percentage is less thaninter_threshold then interaction effect is ignored.verbose logical,if progress bar is to be printedValuedataframe object containing interactions effects greater than or equal to the specified inter_threshold See Alsosafe_extractionExampleslibrary(DALEX)library(randomForest)library(rSAFE)safely_select_variables7 data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1])safely_detect_interactions(explainer_rf,inter_param=0.25,inter_threshold=0.2,verbose=TRUE)safely_select_variablesPerforming Feature Selection on the Dataset with Transformed Vari-ablesDescriptionThe safely_select_variables()function selects variables from dataset returned by safely_transform_data() function.For each original variable exactly one variable is chosen•either original one or transformed one.The choice is based on the AIC value for linear model(regression)or logistic regression(classification).Usagesafely_select_variables(safe_extractor,data,y=NULL,which_y=NULL,class_pred=NULL,verbose=TRUE)Argumentssafe_extractor object containing information about variables transformations created with safe_extraction() functiondata data,original dataset or the one returned by safely_transform_data()function.Ifdata do not contain transformed variables then transformation is done inside thisfunction using’safe_extractor’argument.Data may contain response variable ornot-if it does then’which_y’argument must be given,otherwise’y’argumentshould be provided.y vector of responses,must be given if data does not contain itwhich_y numeric or character(optional),must be given if data contains response valuesclass_pred numeric or character,used only in multi-classification problems.If responsevector has more than two levels,then’class_pred’should indicate the class ofinterest which will denote failure-all other classes will stand for success.verbose logical,if progress bar is to be printed8safely_transform_categorical Valuevector of variables names,selected based on AIC valuesSee Alsosafely_transform_dataExampleslibrary(DALEX)library(randomForest)library(rSAFE)data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1])safe_extractor<-safe_extraction(explainer_rf,verbose=FALSE)safely_select_variables(safe_extractor,data,which_y="m2.price",verbose=FALSE)safely_transform_categoricalCalculating a Transformation of Categorical Feature Using Hierar-chical ClusteringDescriptionThe safely_transform_categorical()function calculates a transformation function for the categorical variable using predictions obtained from black box model and hierarchical clustering.The gap statistic criterion is used to determine the optimal number of clusters.Usagesafely_transform_categorical(explainer,variable,method="complete",B=500,collapse="_")Argumentsexplainer DALEX explainer created with explain()functionvariable a feature for which the transformation function is to be computedmethod the agglomeration method to be used in hierarchical clustering,one of:"ward.D", "ward.D2","single","complete","average","mcquitty","median","centroid"B number of reference datasets used to calculate gap statisticscollapse a character string to separate original levels while combining them to the new oneValuelist of information on the transformation of given variableSee Alsosafe_extractionExampleslibrary(DALEX)library(randomForest)library(rSAFE)data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1])safely_transform_categorical(explainer_rf,"district")safely_transform_continuousCalculating a Transformation of a Continuous Feature UsingPDP/ALE PlotDescriptionThe safely_transform_continuous()function calculates a transformation function for the continuous variable using a PD/ALE plot obtained from black box model.Usagesafely_transform_continuous(explainer,variable,response_type="ale",grid_points=50,N=200,penalty="MBIC",nquantiles=10,no_segments=2)Argumentsexplainer DALEX explainer created with explain()functionvariable a feature for which the transformation function is to be computedresponse_type character,type of response to be calculated,one of:"pdp","ale".If features are uncorrelated,one can use"pdp"type-otherwise"ale"is strongly recommended.grid_points number of points on x-axis used for creating the PD/ALE plot,default50N number of observations from the dataset used for creating the PD/ALE plot, default200penalty penalty for introducing another changepoint,one of"AIC","BIC","SIC","MBIC", "Hannan-Quinn"or numeric non-negative valuenquantiles the number of quantiles used in integral approximationno_segments numeric,a number of segments variable is to be divided into in case of founding no breakpointsValuelist of information on the transformation of given variableSee Alsosafe_extraction,safely_detect_changepointsExampleslibrary(DALEX)library(randomForest)library(rSAFE)data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1])safely_transform_continuous(explainer_rf,"construction.year")safely_transform_data11safely_transform_data Performing Transformations on All Features in the DatasetDescriptionThe safely_transform_data()function creates new variables in dataset using safe_extractor object.Usagesafely_transform_data(safe_extractor,data,verbose=TRUE)Argumentssafe_extractor object containing information about variables transformations created with safe_extraction() functiondata data for which features are to be transformedverbose logical,if progress bar is to be printedValuedata with extra columns containing newly created variablesSee Alsosafe_extraction,safely_select_variablesExampleslibrary(DALEX)library(randomForest)library(rSAFE)data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1])safe_extractor<-safe_extraction(explainer_rf,verbose=FALSE)safely_transform_data(safe_extractor,data,verbose=FALSE)safe_extraction Creating SAFE Extractor-an Object Used for Surrogate-AssistedFeature ExtractionDescriptionThe safe_extraction()function creates a SAFE-extractor object which may be used later for surro-gate feature extraction.Usagesafe_extraction(explainer,response_type="ale",grid_points=50,N=200,penalty="MBIC",nquantiles=10,no_segments=2,method="complete",B=500,collapse="_",interactions=FALSE,inter_param=0.25,inter_threshold=0.25,verbose=TRUE)Argumentsexplainer DALEX explainer created with explain()functionresponse_type character,type of response to be calculated,one of:"pdp","ale".If features are uncorrelated,one can use"pdp"type-otherwise"ale"is strongly recommended.grid_points number of points on x-axis used for creating the PD/ALE plot,default50N number of observations from the dataset used for creating the PD/ALE plot, default200penalty penalty for introducing another changepoint,one of"AIC","BIC","SIC","MBIC", "Hannan-Quinn"or numeric non-negative valuenquantiles the number of quantiles used in integral approximationno_segments numeric,a number of segments variable is to be divided into in case of founding no breakpointsmethod the agglomeration method to be used in hierarchical clustering,one of:"ward.D", "ward.D2","single","complete","average","mcquitty","median","centroid"B number of reference datasets used to calculate gap statisticscollapse a character string to separate original levels while combining them to the newoneinteractions logical,if interactions between variables are to be taken into accountinter_param numeric,a positive value indicating which of single observation non-additiveeffects are to be regarded as significant,the higher value the higher non-additiveeffect has to be to be taken into accountinter_thresholdnumeric,a value from[0,1]interval indicating which interactions should be re-turned as significant.It corresponds to the percentage of observations for whichinteraction measure is greater than inter_param-if this percentage is less thaninter_threshold then interaction effect is ignored.verbose logical,if progress bar is to be printedValuesafe_extractor object containing information about variables transformationSee Alsosafely_transform_categorical,safely_transform_continuous,safely_detect_interactions, safely_transform_dataExampleslibrary(DALEX)library(randomForest)library(rSAFE)data<-apartments[1:500,]set.seed(111)model_rf<-randomForest(m2.price~construction.year+surface+floor+no.rooms+district,data=data)explainer_rf<-explain(model_rf,data=data[,2:6],y=data[,1],verbose=FALSE)safe_extractor<-safe_extraction(explainer_rf,grid_points=30,N=100,verbose=FALSE) print(safe_extractor)plot(safe_extractor,variable="construction.year")Index∗apartmentsapartments,2∗datasetsHR_data,3apartments,2apartmentsTest(apartments),2HR_data,3plot.safe_extractor,3print.safe_extractor,4safe_extraction,6,9–11,12safely_detect_changepoints,5,10safely_detect_interactions,6,13safely_select_variables,7,11safely_transform_categorical,8,13safely_transform_continuous,5,9,13safely_transform_data,8,11,1314。

鱼类和海鲜

鱼类和海鲜

Anchovy-凤尾鱼
• Description: Anchovies are small silvery fish with blue-green backs. They usually never grow larger than 20 cm (8 in). Anchovies prefer the warmer waters around the world. Usage: The usually Using to make salad and frying dishes. 描述: 凤尾鱼是一种银色的小型鱼,背部交织 着蓝绿色。 通常体长20cm,适合在暖水海域生活。 烹调方法: 通常用于制作沙拉和煎炸类菜肴
• •

John Dory-海舫
• Description: There are several varieties of the dory, the most prominent being the John dory. The John dory is also called St. Peter's fish in Europe, because the thumbprint marking on its side is attributed to the legend of the fisherman Simon grasping the fish tightly to search for a coin hidden in its mouth. • Usage: Pan fried, steamed, baked • 描述: 海鲂有很多种类型,多数中的叫做约翰海鲂 鱼,在欧洲也叫圣彼德鱼。明显的标记就是 在鱼的身上有一个指纹大小的标记。 • 烹饪方法: 适于煎,蒸,烤制

Description 描述

Description 描述

What is description?
convey to readers the physical characteristics of a person, place, or thing. five senses---sight, hearing, taste, touch, and smell
Activity 3:
Read the following paragraph carefully and see if you can find the dominant impression of this paragraph.
Please help me find my dog. He is a mongrel (杂种 狗)with the head of a poodle and the body of a wolf hound, and his fur is patchy and dingy(肮脏的)gray. He has only three legs, but despite his arthritis, he uses them pretty well to hobble around and scratch his fleas. His one seeing eye is cloudy, so he runs with his head sideways. He ragged, twisted ears enable him to hear loud sounds, which startle his troubled nervous system and cause hem to howl pitifully. If you give him a scrap of food, he will gum it up rapidly and try to wag his broken tail. He answers to the name of Lucky.

药品说明书旧称description,instruction,direction.今称insert,...

药品说明书旧称description,instruction,direction.今称insert,...

药品说明书旧称description,instruction,direction.今称insert,package insert美国FDA规定其应包括十项。

一.drug names(药物名称)1.通常每种药物有三个名字(1)proprietary name(商品名称)(2)popular name(俗名)(3)chemical name(化学名)2.说明书标题多用商品名其右上角标有R者,表示registered trademark(注册商标)二.description(性状)(常用description,introduction,composition)包括药品的chemical structure(化学结构)、chemical composition(化学成分)、physical and chemical properties (物理和化学性质)三.clinical pharmacology(临床药理学)常用的还有:clinical data(临床数据)、clinical experience(临床经验)、clinical use(临床应用)、clinical observation(临床观察)、clinical effect(临床疗效)、clinical discussion(临床讨论)、mode of mechanism of action(临床机理及途径)、pharmacological actions(药理作用)、therapeutical actions(治疗作用)、bacteriology(细菌学)、microbiology (微生物学)、physiology(生理学)、toxicology(毒理学)四.indications and usage(适应症和用法)常用标题:indications,major indications,clinical indications,principal indications,condications,uses,treatment五.contraindications(禁忌症)1.常用标题contraindications,restriction on use(限制使用)2.常用词(组)pregnant women孕妇women of childbeating age育龄妇女be hypersensitive to 对......过敏者allergic reaction变态反应lactation,early infancy乳期heart,cardiac,myocardial心脏,心脏的,心肌的kidney,renal肾,肾脏的liver,hepatic肝,肝脏的insufficiency,impairment机能不全damage,danger,failure损伤,危险,衰弱六.precautions(注意事项)常用标题:causions,remark,note,notice,attention,awakening, N.B.七.warnings(警告)常用标题:additional warnings(告戒事项)八.adverse reactions(不良反应)常用标题:side reaction(副反应)、untoward reaction(不良反应)、toxicity reaction(毒性反应)、anaphylactic reaction(过敏反应)、side effects,by-effects,after effects,undesirable effects(副作用)、double infection(双重感染)九.overdosage(用药过量)常用标题:treatment of overdosage(用药过量的治疗)十.dosage and administration(剂量用法)1.常用标题:administration procedure,method for administration,method of use,direction for use,how touse,recommendation,reconstitution(用法)posology,dosage(剂量)application and dosage,usage and dosage(用法与剂量)clinical application(临床应用)2.mode of administration(给药方式)intramuscularly肌肉注射intragluteally臀肌注射intraarterially动脉注射intravenously静脉注射intrathecally鞘内注射intracerebeospinally脑脊髓腔注射orally口服parentarally肠道外给药locally局部给药subconjunctivally结膜下给药sublingually舌下给药submucously黏膜下给药现各大药厂的说明书,项目远远超过十项,如:1.animal pharmacology and animal toxicology(动物药理学和动物毒理学)2.absorption and excretion(吸收和排泄)3.tolerance(耐受性)4.drug interactions(药物相互作用)5.storage and duration of efficacy(贮藏与失效期)6.packages(包装)7.advantages(优点)8.references(参考文献)9.further information(补充说明)10.manufacturer(生产者)英文药品说明书的翻译(1)人吃五谷杂粮没有不生病的。

Description

Description
(happy)
2. Concrete details
• Details include specific adjectives, adverbs, and vivid verbs, consistent with the dominant impression.
• Examples are also part of the details which can leave readers some impression about the subject that is to be descripted.
• The direct method is to describe the feeling itself, while the indirect method is to project the emotion back onto the object and to infuse it with feeling in such a way that it will arouse the reader to respond in the way the writer intends.
Hearing
The preacher preached a wonderful rhythmical sermon, all moans and shouts and lonely cries and dire pictures of hell, and then he sang a song about the ninety and nine safe in the fold, but one little lamb was left out in the cold. Then he said: “Won’t you come? Won’t you come to Jesus? Young lambs, won’t you come?”…

unsuseractivityusagedescription -回复

unsuseractivityusagedescription -回复

unsuseractivityusagedescription -回复什么是用户活动分析?为什么用户活动分析对于企业或组织的成功至关重要?如何进行用户活动分析?本文将逐步回答这些问题,让您对用户活动分析有更深入的理解。

用户活动分析是指通过监测、收集和分析用户在特定平台或应用上的行为,以了解他们的兴趣、需求和偏好。

这可以帮助企业或组织更好地理解用户,并基于数据做出更明智的决策。

用户活动分析的关键是从海量的数据中提取有用的信息,并转化为具体的行动计划。

为什么用户活动分析对于企业或组织的成功至关重要呢?首先,用户活动分析可以帮助企业或组织了解他们的目标受众。

通过分析用户活动,可以获得关于用户的详细信息,包括他们的年龄、性别、地理位置、喜好等,从而有针对性地制定营销策略和产品开发计划。

其次,用户活动分析可以揭示用户的行为模式。

通过监测用户在平台或应用上的行为,可以获得他们的点击、浏览、购买等行为数据。

这些数据可以帮助企业或组织了解用户的偏好和习惯,从而改进用户体验,提高用户满意度。

第三,用户活动分析可以发现用户的需求和痛点。

通过分析用户活动,可以发现用户在使用产品或服务时遇到的问题和困扰。

企业或组织可以根据这些痛点做出改进,提供更好的解决方案,增加用户粘性和忠诚度。

最后,用户活动分析有助于预测用户行为和趋势。

通过对历史数据的分析,可以发现用户的行为模式和趋势,并基于这些数据进行预测。

这可以帮助企业或组织提前做出相应的调整和决策,以应对市场变化和用户需求的变化。

那么,如何进行用户活动分析呢?以下是一步一步的指导。

第一步,定义目标和指标。

在进行用户活动分析之前,需要明确分析的目标和希望达到的结果。

例如,希望了解用户的偏好、提高用户满意度等。

然后,选择适当的指标来衡量这些目标,例如点击率、转化率、用户留存率等。

第二步,收集数据。

在进行用户活动分析之前,需要收集相关的数据。

这可以通过安装数据收集工具、监测用户行为或进行用户调研等方式来实现。

peRiodiCS包的说明书

peRiodiCS包的说明书

Package‘peRiodiCS’October14,2022Type PackageTitle Functions for Generating Periodic CurvesVersion0.5.0Date2018-07-02Description Functions for generating variants of curves:restricted cubic spline,periodic restricted cubic spline,periodic cubic spline.Periodic splines can be used to model datathat has periodic nature/seasonality.License GPL-3BugReports https:///crtahlin/peRiodiCS/issuesDepends R(>=2.10)Imports graphics,Hmisc,rmsSuggests testthatLazyData trueRoxygenNote6.0.1NeedsCompilation noAuthor Crt Ahlin[aut,cre],Lara Lusa[aut]Maintainer Crt Ahlin<*******************>Repository CRANDate/Publication2018-07-0509:20:07UTCR topics documented:b_rcs (2)b_rcs_prime (2)cs_per (3)plot_per_mod (3)rcs_per (4)viral_east_mediteranean (5)Index712b_rcs_prime b_rcs Basis for restricted cubic splinesDescriptionFunction that derives the restricted cubic splines for a value/vector of values,given the knots;ob-tains exactly the same results as the rcs function included in the rms package.Usageb_rcs(x,knots,inclx=FALSE)Argumentsx numerical vectorknots vector specifying the knot locationsinclx logical,if TRUE returns also the x vectorb_rcs_prime Derivefirst derivatives of RCSDescriptionfunction that derives thefirst derivative of the restricted cubic splines for a value/vector of values, given the knotsUsageb_rcs_prime(x,knots)Argumentsx vector of valuesknots vector of knot locationscs_per3 cs_per Generate design matrix for periodic cubic splinesDescriptionGenerate design matrix for periodic cubic splines.Usagecs_per(x,knots=NULL,nk=5,xmax=max(x,na.rm=TRUE),xmin=min(x,na.rm=TRUE))Argumentsx numerical x values to transform to new basisknots vector with locations of the knots of the splinenk number of knots,used only if the knots are not specified,overridden otherwise xmax value of the(theoretical)minimum of xxmin value of the(theoretical)maximum of xExamples#load example data;see help("viral_east_mediteranean")data("viral_east_mediteranean")#calculate location of knots to useKnots<-Hmisc::rcspline.eval(x=viral_east_mediteranean$EpiWeek,nk=5,knots.only=TRUE)#model viral infections vs weeksmodel<-glm(RSV~cs_per(EpiWeek,knots=Knots),data=viral_east_mediteranean)#plot model(with many points,to make it smooth)plot_per_mod(Model=model,XvarName="EpiWeek",Smooth=TRUE)plot_per_mod Plotting function for periodic curves modelDescriptionPlots graph of periodic curves with confidence intervals.Data should be included in the model.4rcs_perUsageplot_per_mod(Model,XvarName,Ylab="Response",Xlab="Covariate",Ylim=NULL,Xlim=NULL,Xmin=NULL,Xmax=NULL,Knots=NULL,Title=NULL,Vlines=NULL,Hlines=NULL,b=NULL,Cex.main=NULL,Cex.axis=NULL,Axes=TRUE,Add=FALSE,Col="black",PlotCI=TRUE,Smooth=FALSE,xLocation=2)ArgumentsModel The built modelXvarName Name of the x variable in the dataset(column name)Ylab Label on vertical(y)axisXlab Label on horizontal(x)axisYlim Limits of y axisXlim Limits of x axisXmin The min X of data to be predicted(if Smooth)Xmax The max X of data to be predicted(if Smooth)Knots Locations of knots of the splinesTitle Title of the plotVlines Where to plot vertical linesHlines Where to plot horizontal linesb Character expansion(aka"size of font")for the labelsCex.main Character expansion for main textCex.axis Character expansion for the axis textAxes Plot axesAdd Add to existing plotCol Color of the plotted linesPlotCI Plot confidence intervalsSmooth Make the Xaxis values equidistant(and the curve smoother)xLocation If smooth FALSE,the location of the x term in model$x[,xLocation]rcs_per Generate design matrix for periodic restricted cubic splineDescriptionGenerate design matrix for periodic restricted cubic spline.Usagercs_per(x,knots=NULL,nk=5,xmin=min(x,na.rm=TRUE),xmax=max(x,na.rm=TRUE))Argumentsx numerical x values to transform to new basisknots vector with locations of the knots of the splinenk number of knots,used only if the knots are not specified,overridden otherwisexmin value of the(theoretical)minimum of xxmax value of the(theoretical)maximum of x#’@examples#load example data;see help("viral_east_mediteranean")data("viral_east_mediteranean")#calculate location of knots to use Knots<-Hmisc::rcspline.eval(x=viral_east_mediteranean$EpiWeek,nk=5,knots.only=TRUE)#model viral infections vs weeks model<-glm(RSV~rcs_per(EpiWeek,knots=Knots),data=viral_east_mediteranean)#plot model(with many points,to make it smooth)plot_per_mod(Model=model,XvarName="EpiWeek",Smooth=TRUE)viral_east_mediteraneanViral etiology,seasonality and severity of hospitalized patients withsevere acute respiratory infections in the Eastern Mediterranean Re-gion,2007-2014DescriptionData about infections with different viruses across several years.For more information see Source and References section.Usageviral_east_mediteraneanFormatA data frame with variables:UniqueID record identification numberEnrolled Did the patient consent and enroll in the study?:1=Yes,0=NoCountry Country of enrollment:Egypt,Jordan,Oman,Qatar,YemenEpiYear Year of enrollment:Integers(2007-2014)EpiMonth Month of enrollment:Integers(1-12)EpiWeek Week of enrollment:Integers(1-53)Interval Number of days between onset of symptoms and hospitalization:IntegerStay Number of days between hospitalization and outcome:IntegerSex Sex:1=Female,0=MaleAgeGrp Age group:1=<1year,2=1-4years,3=5-49years,4=50+yearsChronicDis Does the patient have any pre-existing chronic disease?:1=Yes,0=NoOxTherapy Did the patient receive oxygen therapy during hospitalization?:1=Yes,0=NoVentilated Was the patient ventilated during hospitalization?:1=Yes,0=NoICU Was the patient admitted to an intensive care unit during hospitalization?:1=Yes,0=NoOutcome What was the patient"’"sfinal hospitalization outcome?:1=Discharge,2=Transfer,3=Death RSV Results for respiratory syncytial virus:1=Positive,0=NegativeAdV Results for adenovirus:1=Positive,0=NegativehMPV Results for human metapneumovirus:1=Positive,0=NegativehPIV1Results for human parainfluenzavirus type1:1=Positive,0=NegativehPIV2Results for human parainfluenzavirus type2:1=Positive,0=NegativehPIV3Results for human parainfluenzavirus type3:1=Positive,0=NegativeFlu Results for influenza:1=Positive,0=NegativeSource/plosone/article?id=10.1371/journal.pone.0180954ReferencesHorton,Katherine C.AND Dueger,Erica L.AND Kandeel,Amr AND Abdallat,Mohamed AND El-Kholy,Amani AND Al-Awaidy,Salah AND Kohlani,Abdul Hakim AND Amer,Hanaa AND El-Khal,Abel Latif AND Said,Mayar AND House,Brent AND Pimentel,Guillermo AND Talaat, Maha(2017).Viral etiology,seasonality and severity of hospitalized patients with severe acute respiratory infections in the Eastern Mediterranean Region,2007-2014.PLOS ONE,12,1-17.Index∗datasetsviral_east_mediteranean,5b_rcs,2b_rcs_prime,2cs_per,3plot_per_mod,3rcs_per,4viral_east_mediteranean,57。

Cohort 分析帮助说明书

Cohort 分析帮助说明书

Package‘cohorts’October12,2022Title Cohort Analysis Made EasyVersion1.0.1Description Functions to simplify the process of preparing event and transaction for cohort analysis. License MIT+file LICENSEURL https:///PeerChristensen/cohortsBugReports https:///PeerChristensen/cohorts/issuesEncoding UTF-8LazyData trueRoxygenNote7.1.1Imports data.table,dplyr,dtplyr,magrittr,tibble,tidyr,zooDepends R(>=2.10)Suggests testthat(>=3.0.0)Config/testthat/edition3NeedsCompilation noAuthor Peer Christensen[aut,cre]Maintainer Peer Christensen<*************************>Repository CRANDate/Publication2022-05-1522:10:05UTCR topics documented:cohort_table_day (2)cohort_table_month (2)cohort_table_pct (3)gamelaunch (4)online_cohorts (4)shift_left (5)shift_left_pct (5)Index712cohort_table_month cohort_table_day Create a Cohort Table Using Day Level Event DataDescriptionCreates a cohort table with day level event data with rows corresponding to cohort numbers and columns as dates.Usagecohort_table_day(df,id_var,date)Argumentsdf Dataframeid_var ID variabledate DateValueCohort tableExamplescohort_table_day(gamelaunch,userid,eventDate)cohort_table_month Create a Cohort Table Using Month Level Event DataDescriptionCreates a cohort table with month level event data with rows corresponding to cohort numbers and columns as months.Usagecohort_table_month(df,id_var,date)Argumentsdf Dataframeid_var ID variabledate Datecohort_table_pct3 ValueCohort tableExamplescohort_table_month(online_cohorts,CustomerID,InvoiceDate)cohort_table_pct Convert Values of a Cohort Table to PercentagesDescriptionConverts values of a cohort table to percentages of initial cohort sizes.Usagecohort_table_pct(cohort_table,decimals=1)Argumentscohort_table Cohort tabledecimals IntegerValueCohort tableExamplesonline_cohorts%>%cohort_table_month(CustomerID,InvoiceDate)%>%cohort_table_pct(decimals=1)4online_cohorts gamelaunch Event Data From the Launch of a Mobile GameDescriptionA dataset containing29324observations with three columns:userid,eventDate and eventName.UsagegamelaunchFormatA data frame with29324rows and3variables:userid User IDeventDate Event DateeventName Event Name...online_cohorts Order Data From an Online StoreDescriptionA dataset containing19573observations with two columns:CustomerID and InvoiceDateUsageonline_cohortsFormatA data frame with19,573rows and2variables:CustomerID Customer IDInvoiceDate InvoiceDate...shift_left5 shift_left Left-shift a Cohort TableDescriptionLeft-shifts a cohort tableUsageshift_left(cohort_table)Argumentscohort_table Cohort tableValueCohort tableExamplesonline_cohorts%>%cohort_table_month(CustomerID,InvoiceDate)%>%shift_left()shift_left_pct Left-shift a Cohort Table With Cohort Sizes as PercentagesDescriptionLeft-shifts a cohort table with cohort sizes as percentages of start sizes.Usageshift_left_pct(cohort_table,decimals=1)Argumentscohort_table Cohort tabledecimals IntegerValueCohort table6shift_left_pctExamplesonline_cohorts%>%cohort_table_month(CustomerID,InvoiceDate)%>%shift_left_pct()Index∗datasetsgamelaunch,4online_cohorts,4cohort_table_day,2cohort_table_month,2cohort_table_pct,3gamelaunch,4online_cohorts,4shift_left,5shift_left_pct,57。

DCMI元数据术语

DCMI元数据术语

DCMI 元数据术语DCMI 元数据术语题名: DCMI 元数据术语创建者: DCMI 应用委员会(DCMI Usage Board )标识符: /documents/2006/08/28/dcmi-terms/发布日期: 2006-08-28最新版本: /documents/dcmi-terms/替代: /documents/2005/06/13/dcmi-terms/翻译: /resources/translations/文档状态: DCMI 的推荐标准描述: 本文档是DCMI 维护的所有元数据术语的最新说明,包括元素、元素限定、编码体系和词汇生效日期: 2006-08-28目录1. 介绍和定义2.都柏林核心元数据元素集 3.其他元素和元素限定 4. 编码体系 5.DCMI 类型词表 6. DCMI 术语综述第一部分:介绍和定义本文档是最新的由DCMI维护的所有元数据术语的权威说明,包括元素、元素限定、编码体系和词汇术语(DCMI 类型词汇表)。

指向其它相关文档的链接可以在"Overview of Documentation for DCMI Metadata Terms" [OVERVIEW]文档中找到。

涵盖本文档子集的遗留文档有许多公开的形式,例如:IETF RFC 2413 [RFC2413],CEN工作组协议CWA 13874 [CWA13874], NISO标准Z39.85-2001 [Z3985],ISO标准15836-2003[ISO15836],以及包括所有或部分DC元素的各种国家标准。

每一个术语由以下最小属性集具体说明:名称:赋予数据元素的唯一标记。

URI:用于唯一标识该术语的统一资源标识符。

标签:分配给术语的标签(人类可读)。

定义:对术语概念和性质的明确说明。

术语类型:如“元素”、“编码体系”等术语类型,在DCMI语法规则(DCMI Grammatical Principles)中有规定。

countgmifs包的说明文档说明书

countgmifs包的说明文档说明书

Package‘countgmifs’October12,2022Title Discrete Response Regression for High-Dimensional DataVersion0.0.2Description Provides a function forfitting Poisson and negative binomial regression mod-els when the number of parameters exceeds the sample size,using the the generalized mono-tone incremental forward stagewise method.Depends R(>=3.5.0),MASSLicense GPL(>=2)Encoding UTF-8LazyData trueRoxygenNote6.0.1.9000NeedsCompilation noAuthor Kellie Archer[aut,cre]Maintainer Kellie Archer<*****************>Repository CRANDate/Publication2020-01-0814:20:02UTCR topics documented:countgmifs-package (2)coef.countgmifs (3)countgmifs (4)plot.countgmifs (5)predict.countgmifs (6)print.countgmifs (7)summary.countgmifs (7)Index912countgmifs-packagecountgmifs-package Discrete Response Regression for High-Dimensional Data:DiscreteResponse Generalized Monotone Incremental Forward Stagewise Re-gressionDescriptionThis package provides a function thatfits a Poisson or negative binomial model when the numberof parameters exceeds the sample size,using the the generalized monotone incremental forwardstagewise method.DetailsThe DESCRIPTIONfile:Package:countgmifsTitle:Discrete Response Regression for High-Dimensional DataVersion:0.0.2Authors@R:person("Kellie","Archer",email="*****************",role=c("aut","cre"))Description:Provides a function forfitting Poisson and negative binomial regression models when the number of paramet Depends:R(>=3.5.0),MASSLicense:GPL(>=2)Encoding:UTF-8LazyData:trueRoxygenNote: 6.0.1.9000Author:Kellie Archer[aut,cre]Maintainer:Kellie Archer<*****************>Index of help topics:coef.countgmifs Extract Model Coefficients.countgmifs Discrete Response Generalized MonotoneIncremental Forward Stagewise Regression.countgmifs-package Discrete Response Regression forHigh-Dimensional Data:Discrete ResponseGeneralized Monotone Incremental ForwardStagewise Regressionplot.countgmifs Plot Solution Path for a Count GMIFS FittedModel.predict.countgmifs Predict Outcome for Count GMIFS Fitted Model.print.countgmifs Print the Contents of a Count GMIFS FittedObject.summary.countgmifs Summarize a Count GMIFS Object.This package contains functions forfitting a penalized discrete response model(either negativebinomial or Poisson)and extracting estimated coefficients,predictions,and plots.The model andcoef.countgmifs3 methods can be used when the response to be predicted is discrete,and is particularly relevant whenthere are more covariates than observations.Author(s)NA Kellie J.Archer<*****************>Maintainer:NA Kellie J.Archer<*****************>ReferencesMakowski M.,Archer K.J.(2015)Generalized monotone incremental forward stagewise method formodeling count data:application predicting micronuclei frequency.Cancer Informatics,14(Suppl2),97–105.coef.countgmifs Extract Model Coefficients.DescriptionA generic function which extracts the model coefficients from afitted model objectfit using countgmifsUsage##S3method for class countgmifscoef(object,model.select="BIC",...)Argumentsobject an countgmifsfitted object.model.select when x is specified any model along the solution path can be selected.Thedefault is model.select="BIC"which calculates the predicted values using thecoefficients from the model having the lowest BIC.Other options are model.select="AIC"or any numeric value from the solution path....other arguments.See AlsoSee Also countgmifs,predict.countgmifs,summary.countgmifs,plot.countgmifs4countgmifscountgmifs Discrete Response Generalized Monotone Incremental ForwardStagewise Regression.DescriptionThis function canfit a Poisson or negative binomial model when the number of parameters exceeds the sample size,using the the generalized monotone incremental forward stagewise method.Usagecountgmifs(formula,data,x=NULL,offset,subset,epsilon=0.001,tol=1e-05,scale=TRUE,verbose=FALSE,family="nb",...)Argumentsformula an object of class"formula"(or one that can be coerced to that class):a sym-bolic description of the model to befitted.The left side of the formula is theordinal outcome while the variables on the right side of the formula are thecovariates that are not included in the penalization process.Note that if all vari-ables in the model are to be penalized,an intercept only model formula shouldbe specified.data an optional data frame,list or environment(or object coercible by as.data.frame to a data frame)containing the variables in the model.x an optional matrix of predictors that are to be penalized in the modelfitting process.offset this can be used to specify an a priori known component to be included during fitting(e.g.,denominator term).This should be NULL or a numeric vector oflength equal to the number of cases.subset an optional vector specifying a subset of observations to be used in thefitting process.epsilon small incremental amount used to update a coefficient at a given step.tol the iterative process stops when the difference between successive log-likelihoods is less than this specified level of tolerance.scale logical,if TRUE(default)the penalized predictors are centered and scaled.verbose logical,if TRUE the step number is printed to the console(default is FALSE).family the type of count response model to befit.Default is’nb’for negative binomial;user can also specify’poisson’....other arguments.See AlsoSee Also coef.countgmifs,summary.countgmifs,predict.countgmifs,plot.countgmifsplot.countgmifs5Examplesset.seed(26)n<-50#Sample sizep<-500#Number of covariatesintercept<-.5#True parameter values for the500covariatesbeta<-c(log(1.5),log(1.5),-log(1.5),-log(1.5),-log(1.5),rep(0,495))alpha<-0.5#Interceptx<-matrix(rnorm(n*p,0,1),nrow=n,ncol=p,byrow=TRUE)#Covariate valuescolnames(x)<-paste("Var",1:p,sep="")mu<-exp(intercept+crossprod(t(x),beta))y<-rnbinom(n=n,size=1/alpha,mu=mu)#Discrete responsedata<-data.frame(y,x)nb<-countgmifs(y~1,data=data,offset=NULL,x=x,epsilon=0.01,tol=0.001, scale=TRUE,verbose=FALSE)coef.AIC<-coef(nb,model.select="AIC")coef.AIC[coef.AIC!=0]predict(nb,model.select="AIC")plot(predict(nb,model.select="AIC"),y)plot(nb)plot.countgmifs Plot Solution Path for a Count GMIFS Fitted Model.DescriptionThis function plots either the coefficient path,the AIC,or the log-likelihood for afitted countgmifs object.Usage##S3method for class countgmifsplot(x,type="trace",xlab=NULL,ylab=NULL,main=NULL,...)Argumentsx a countgmifs object.type default is"trace"which plots the coefficient path for thefitted object.Also available are"AIC","BIC",and"logLik".xlab a default x-axis label will be used which can be changed by specifying a user-defined x-axis label.ylab a default y-axis label will be used which can be changed by specifying a user-defined y-axis label.main a default main title will be used which can be changed by specifying a user-defined main title....other arguments.See AlsoSee Also countgmifs,coef.countgmifs,summary.countgmifs,predict.countgmifspredict.countgmifs Predict Outcome for Count GMIFS Fitted Model.DescriptionThis function returns a numeric vector that is the predicted response from the countgmifsfittedobject.Usage##S3method for class countgmifspredict(object,neww=NULL,newdata,newx=NULL,model.select="BIC",newoffset=NULL,...)Argumentsobject an ordinalgmifsfitted object.neww an optional formula that includes the unpenalized variables to use for predictingthe response.If omitted,the training data are used.newdata an optional data.frame that minimally includes the unpenalized variables to usefor predicting the response.If omitted,the training data are used.newx an optional matrix of penalized variables to use for predicting the response.Ifomitted,the training data are used.model.select when x is specified any model along the solution path can be selected.Thedefault is model.select="BIC"which calculates the predicted values using thecoefficients from the model having the lowest BIC.Other options are model.select="AIC"or any numeric value from the solution path.newoffset If an offset is used in thefit,then one must be supplied for making predictions....other arguments.See AlsoSee Also countgmifs,coef.countgmifs,summary.countgmifs,plot.countgmifsprint.countgmifs Print the Contents of a Count GMIFS Fitted Object.DescriptionThis function prints the names of the list objects from an countgmifsfitted modelUsage##S3method for class countgmifsprint(x,...)Argumentsx an countgmifsfitted object....other arguments.See AlsoSee Also countgmifs,coef.countgmifs,summary.countgmifs,plot.countgmifssummary.countgmifs Summarize a Count GMIFS Object.DescriptionPrints the following items extracted from thefitted countgmifs object:the family used and modelparameter estimates.For models that include x,the parameter estimates,AIC,BIC,and log-likelihood are printed for indicated model.select step or if model.select is not supplied thestep at which the minimum BIC was observed.Usage##S3method for class countgmifssummary(object,model.select="BIC",...)Argumentsobject an countgmifsfitted object.model.select when x is specified any model along the solution path can be selected.Thedefault is model.select="BIC"which calculates the predicted values using thecoefficients from the model having the lowest BIC.Other options are model.select="AIC"or any numeric value from the solution path....other arguments.8summary.countgmifsSee AlsoSee Also countgmifs,coef.countgmifs,predict.countgmifs,plot.countgmifsIndex∗methodscoef.countgmifs,3countgmifs,4plot.countgmifs,5predict.countgmifs,6print.countgmifs,7summary.countgmifs,7∗modelscountgmifs-package,2∗packagecountgmifs-package,2∗regressioncountgmifs,4countgmifs-package,2coef.countgmifs,3,4,6–8countgmifs,3,4,6–8countgmifs-package,2fitted.countgmifs(predict.countgmifs),6plot.countgmifs,3,4,5,6–8predict.countgmifs,3,4,6,6,8print.countgmifs,7summary.countgmifs,3,4,6,7,79。

dbx数据库接口说明书

dbx数据库接口说明书

Package‘dbx’December11,2023Type PackageTitle A Fast,Easy-to-Use Database InterfaceVersion0.3.1Date2023-12-11Description Provides select,insert,update,upsert,and delete database operations.Supports'Post-greSQL','MySQL','SQLite',and more,and plays nicely with the'DBI'package.URL https:///ankane/dbxBugReports https:///ankane/dbx/issuesLicense MIT+file LICENSERoxygenNote7.2.3Encoding UTF-8Imports DBI(>=1.0.0)Suggests testthat(>=1.0.2),urltools(>=1.7.0),RSQLite(>=2.1.2),RMariaDB,RMySQL(>=0.10.20),RPostgres,RPostgreSQL,hms,jsonlite,blob,odbcNeedsCompilation noAuthor Andrew Kane[aut,cre]Maintainer Andrew Kane<********************>Repository CRANDate/Publication2023-12-1121:10:02UTCR topics documented:dbxConnect (2)dbxDelete (3)dbxDisconnect (3)dbxExecute (4)dbxInsert (4)dbxSelect (5)dbxUpdate (6)dbxUpsert (6)12dbxConnect Index8dbxConnect Create a database connectionDescriptionCreate a database connectionUsagedbxConnect(url=NULL,adapter=NULL,storage_tz=NULL,variables=list(),...)Argumentsurl A database URLadapter The database adapter to usestorage_tz The time zone timestamps are stored invariables Session variables...Arguments to pass to dbConnectExamples#SQLitedb<-dbxConnect(adapter="sqlite",dbname=":memory:")##Not run:#Postgresdb<-dbxConnect(adapter="postgres",dbname="mydb")#MySQLdb<-dbxConnect(adapter="mysql",dbname="mydb")#Othersdb<-dbxConnect(adapter=odbc(),database="mydb")##End(Not run)dbxDelete3 dbxDelete Delete recordsDescriptionDelete recordsUsagedbxDelete(conn,table,where=NULL,batch_size=NULL)Argumentsconn A DBIConnection objecttable The table name to delete records fromwhere A data frame of records to deletebatch_size The number of records to delete in a single statement(defaults to all)Examplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")table<-"forecasts"DBI::dbCreateTable(db,table,data.frame(id=1:3,temperature=20:22))#Delete specific recordsbad_records<-data.frame(id=c(1,2))dbxDelete(db,table,where=bad_records)#Delete all recordsdbxDelete(db,table)dbxDisconnect Close a database connectionDescriptionClose a database connectionUsagedbxDisconnect(conn)Argumentsconn A DBIConnection object4dbxInsertExamplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")dbxDisconnect(db)dbxExecute Execute a statementDescriptionExecute a statementUsagedbxExecute(conn,statement,params=NULL)Argumentsconn A DBIConnection objectstatement The SQL statement to useparams Parameters to bindExamplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")DBI::dbCreateTable(db,"forecasts",data.frame(id=1:3,temperature=20:22))dbxExecute(db,"UPDATE forecasts SET temperature=20")dbxExecute(db,"UPDATE forecasts SET temperature=?",params=list(20))dbxExecute(db,"UPDATE forecasts SET temperature=?WHERE id IN(?)",params=list(20,1:3)) dbxInsert Insert recordsDescriptionInsert recordsUsagedbxInsert(conn,table,records,batch_size=NULL,returning=NULL)dbxSelect5Argumentsconn A DBIConnection objecttable The table name to insertrecords A data frame of records to insertbatch_size The number of records to insert in a single statement(defaults to all)returning Columns to returnExamplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")table<-"forecasts"DBI::dbCreateTable(db,table,data.frame(id=1:3,temperature=20:22))records<-data.frame(temperature=c(32,25))dbxInsert(db,table,records)dbxSelect Select recordsDescriptionSelect recordsUsagedbxSelect(conn,statement,params=NULL)Argumentsconn A DBIConnection objectstatement The SQL statement to useparams Parameters to bindExamplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")DBI::dbCreateTable(db,"forecasts",data.frame(id=1:3,temperature=20:22))dbxSelect(db,"SELECT*FROM forecasts")dbxSelect(db,"SELECT*FROM forecasts WHERE id=?",params=list(1))dbxSelect(db,"SELECT*FROM forecasts WHERE id IN(?)",params=list(1:3))dbxUpdate Update recordsDescriptionUpdate recordsUsagedbxUpdate(conn,table,records,where_cols,batch_size=NULL,transaction=TRUE)Argumentsconn A DBIConnection objecttable The table name to updaterecords A data frame of records to insertwhere_cols The columns to use for WHERE clausebatch_size The number of records to update in a single transaction(defaults to all) transaction Wrap the update in a transaction(defaults to true)Examplesdb<-dbxConnect(adapter="sqlite",dbname=":memory:")table<-"forecasts"DBI::dbCreateTable(db,table,data.frame(id=1:3,temperature=20:22))records<-data.frame(id=c(1,2),temperature=c(16,13))dbxUpdate(db,table,records,where_cols=c("id"))dbxUpsert Upsert recordsDescriptionUpsert recordsUsagedbxUpsert(conn,table,records,where_cols,batch_size=NULL,returning=NULL,skip_existing=FALSE)Argumentsconn A DBIConnection objecttable The table name to upsertrecords A data frame of records to upsertwhere_cols The columns to use for WHERE clausebatch_size The number of records to upsert in a single statement(defaults to all) returning Columns to returnskip_existing Skip existing rowsExamples##Not run:db<-dbxConnect(adapter="postgres",dbname="dbx")table<-"forecasts"DBI::dbCreateTable(db,table,data.frame(id=1:3,temperature=20:22))records<-data.frame(id=c(3,4),temperature=c(20,25))dbxUpsert(db,table,records,where_cols=c("id"))##End(Not run)IndexdbxConnect,2dbxDelete,3dbxDisconnect,3dbxExecute,4dbxInsert,4dbxSelect,5dbxUpdate,6dbxUpsert,68。

THredds包说明书

THredds包说明书

Package‘thredds’September1,2023Title Crawler for Navigating THREDDS CatalogsDescription Provides a crawler for programmatically navigating THREDDS Data Server(<https: ///software/tds/>)catalogs,and access dataset metadata and resources.Version0.1-4Date2023-09-01Depends R(>=3.0)Imports R6,rlang,magrittr,httr,xml2Suggests ncdf4,testthatMaintainer Emmanuel Blondel<***************************>URL https:///BigelowLab/thredds,https:///software/tds/License MIT+file LICENSEEncoding UTF-8RoxygenNote7.2.3NeedsCompilation noAuthor Ben Tupper[aut],Emmanuel Blondel[aut,cre](<https:///0000-0002-5870-5762>),Bigelow Laboratory for Ocean Sciences[cph]Repository CRANDate/Publication2023-09-0109:40:01UTCR topics documented:build_xpath (2)CatalogNode (2)DatasetNode (6)get_catalog (8)get_xml_ns (8)grepl_it (9)1is_xmlNode (9)parse_node (10)ServiceNode (10)thredds (11)ThreddsNode (12)xmlString (14)xml_children_names (14)xml_id (15)Index16build_xpath Build and xpath string,possibly using the user specified namespaceprefix.DescriptionBuild and xpath string,possibly using the user specified namespace prefix.Usagebuild_xpath(x,prefix="d1",select=".//")Argumentsx character one or more path segmentsprefix character by default"d1"prepended to each of the segements in x.If NA or length is0then ignore.select charcater,by default search anywhere in the current node with".//"Valuexpath descriptorCatalogNode A class for Catalogs(which may contain catalogs references ordatasets)DescriptionA catalog representation that sublcasses from ThreddsNodeSuper classthredds::ThreddsNode->CatalogNodeMethodsPublic methods:•CatalogNode$list_services()•CatalogNode$list_catalogs()•CatalogNode$list_datasets()•CatalogNode$get_catalogs()•CatalogNode$get_datasets()•CatalogNode$get_dataset_names()•CatalogNode$get_catalog_names()•CatalogNode$parse_catalog_node()•CatalogNode$parse_dataset_node()•CatalogNode$print()•CatalogNode$clone()Method list_services():list available servicesUsage:CatalogNode$list_services(xpath=build_xpath("service",prefix=self$prefix),form="list")Arguments:xpath character,the xpath specificationsform character,either"list"or"table"Returns:list of zero or more character vectorsMethod list_catalogs():list available catalogRefsUsage:CatalogNode$list_catalogs(xpath=build_xpath(c("dataset","catalogRef"),prefix=self$prefix),form="list")Arguments:xpath character,the xpath descriptorform character,either"list"or"table"Returns:a list with zero or more character vectorsMethod list_datasets():list available datasetsUsage:CatalogNode$list_datasets(xpath=build_xpath(c("dataset","dataset"),prefix=self$prefix),form="list")Arguments:xpath character,the xpath descriptorform character,either"list"or"table"Returns:a list with zero or more character vectorsMethod get_catalogs():Retrieve a list one or more of child catalogsUsage:CatalogNode$get_catalogs(index,xpath=build_xpath(c("dataset","catalogRef"),prefix=self$prefix))Arguments:index integer index(1,...,nChild),indices or name(s)xpath character xpath representationReturns:a list of Catalog class objects,possibly NULLMethod get_datasets():Retrieve list one or more dataset childrenUsage:CatalogNode$get_datasets(index,xpath=build_xpath(c("dataset","dataset"),prefix=self$prefix))Arguments:index the integer index(1,...,nChild),indices or name(s)xpath character xpath representationReturns:a list of Dataset objects or NULLMethod get_dataset_names():Retrieve list zero or more dataset child names.If unnnamed, then we substitute"title","ID","urlPath",or"href"in that order of availability.Usage:CatalogNode$get_dataset_names(xpath=build_xpath(c("dataset","dataset"),prefix=self$prefix))Arguments:xpath character xpath representationindex the integer index(1,...,nChild),indices or name(s)Returns:character vector of zero or more namesMethod get_catalog_names():Retrieve list zero or more catalog child names.If unnnamed, then we substitute"title","ID","urlPath"or href"in that order of availability.Usage:CatalogNode$get_catalog_names(xpath=build_xpath(c("dataset","catalogRef"),prefix=self$prefix))Arguments:xpath character xpath representationindex the integer index(1,...,nChild),indices or name(s)Returns:character vector of zero or more namesMethod parse_catalog_node():Parse a catalog nodeUsage:CatalogNode$parse_catalog_node(x)Arguments:x xml_nodeReturns:Catalog class objectMethod parse_dataset_node():Parse a dataset nodeUsage:CatalogNode$parse_dataset_node(x)Arguments:x xml_nodeReturns:Dataset class objectMethod print():print methodUsage:CatalogNode$print(prefix="")Arguments:prefix character,to be printed before each line of output(like spaces)...other arguments for superclassMethod clone():The objects of this class are cloneable with this method.Usage:CatalogNode$clone(deep=FALSE)Arguments:deep Whether to make a deep clone.Exampleslibrary(thredds)top_uri<- https:///opendap/catalog.xml Top<-thredds::CatalogNode$new(top_uri)#to browse catalogue#Top$browse()#go down in MODISA catalogL3<-Top$get_catalogs("MODISA")[["MODISA"]]$get_catalogs()[[1]]#see what s available for2009catalog2009<-L3$get_catalogs("2009")[[1]]#get catalog for2009-01-20doy<-format(as.Date("2009-01-20"),"%m%d")catalog20<-catalog2009$get_catalogs(doy)[[doy]]#get dataset nodechl<-catalog20$get_datasets("AQUA_MODIS.20090120.L3m.DAY.CHL.chlor_a.4km.nc")[[1]] #retrieve the relative URL,and add it to the base URL for the service.#Somewhat awkwardly,the relative URL comes prepended with a path separator,so we#use straight up paste0 to append to the base_uri.#if(require("ncdf4")){#base_uri<-"https://:443/opendap"#uri<-paste0(base_uri,chl[["AQUA_MODIS.20090120.L3m.DAY.CHL.chlor_a.4km.nc"]]$url) #NC<-ncdf4::nc_open(uri)#}DatasetNode A class for a single datatset referenceDescriptionA direct Dataset representation that subclasses from ThreddsNodeSuper classthredds::ThreddsNode->DatasetNodePublicfieldsname character,often thefilenamedataSize numeric,size in bytesdate character,modification dateMethodsPublic methods:•DatasetNode$new()•DatasetNode$GET()•DatasetNode$get_url()•DatasetNode$list_access()•DatasetNode$print()•DatasetNode$clone()Method new():initialize an instance of ServiceNodeUsage:DatasetNode$new(x,...)Arguments:x url or xml2::xml_node...arguments for superclass initializationMethod GET():Overrides the GET method of the superclass.GET is not permittedUsage:DatasetNode$GET()Returns:NULLMethod get_url():Retrieve the relative URL for a dataset.Usage:DatasetNode$get_url(service=c("dap","opendap","wms")[1],sep=c("/","")[2],...)Arguments:service character,the service to use.(default’dap’equivalent to’opendap’)Ignored if‘url-Path‘or‘href‘is in the nodes’attributes.sep character,typically"/"or""(default),used for joined base_url to relative url...other arguments for DatasetNode$list_accessReturns:characterMethod list_access():list access methodsUsage:DatasetNode$list_access(xpath=build_xpath("access",prefix=self$prefix)) Arguments:xpath charcater,xpath descriptorReturns:named list of character vectors or NULLMethod print():print methodUsage:DatasetNode$print(prefix="")Arguments:prefix character,to be printed before each line of output(like spaces)...other arguments for superclassMethod clone():The objects of this class are cloneable with this method.Usage:DatasetNode$clone(deep=FALSE)Arguments:deep Whether to make a deep clone.8get_xml_nsNoteFor examples see CatalogNodeget_catalog Retrieve a catalogDescriptionRetrieve a catalogUsageget_catalog(uri,...)Argumentsuri the URI of the catalog...further arguments for parse_nodeValueThreddsNodeRefClass or subclass or NULLget_xml_ns Retrieve the namespaces for a resourceDescriptionRetrieve the namespaces for a resourceUsageget_xml_ns(uri)Argumentsuri the URI of the catalogValuethe output of xml_nsgrepl_it9 grepl_it Determine if a vector of names match the greplargsDescriptionDetermine if a vector of names match the greplargsUsagegrepl_it(x,greplargs=NULL)Argumentsx a vector of namesgreplargs NULL,vector or listValuelogical vectoris_xmlNode Test if an object inherits from xml2::xml_nodeDescriptionTest if an object inherits from xml2::xml_nodeUsageis_xmlNode(x,classname="xml_node")Argumentsx object to testclassname character,the class name to test against,by default’xml_node’Valuelogical10ServiceNode parse_node Convert a node to an object inheriting from ThreddsNodeDescriptionConvert a node to an object inheriting from ThreddsNodeUsageparse_node(node,url=NULL,verbose=FALSE,encoding="UTF-8",...)Argumentsnode xml2::xml_node or an httr::response objecturl character,optional url if a catalog or direct datasetverbose logical,by default FALSEencoding character,by default UTF-8...further arguments for instantiation of classes(such as ns="foo")ValueThreddsNode class object or subclassServiceNode A simple class for parsing and holdoing service infoDescriptionA Service representation that subclasses from ThreddsNodeSuper classthredds::ThreddsNode->ServiceNodePublicfieldsname characterserviceType characterbase character base urlthredds11 MethodsPublic methods:•ServiceNode$new()•ServiceNode$print()•ServiceNode$clone()Method new():initialize an instance of ServiceNodeUsage:ServiceNode$new(x,...)Arguments:x url or xml2::xml_node...arguments for superclass initializationMethod print():print methodUsage:ServiceNode$print(prefix="")Arguments:prefix character,to be printed before each line of output(like spaces)...other arguments for superclassMethod clone():The objects of this class are cloneable with this method.Usage:ServiceNode$clone(deep=FALSE)Arguments:deep Whether to make a deep clone.NoteFor examples see CatalogNodethredds thredds:Crawler for Navigating THREDDS CatalogsDescriptionA limited crawler for programmatically navigating THREDDS catalogs.ThreddsNode A base representation that other nodes subclass fromDescriptionR6base class for all other to inherit fromPublicfieldsurl character-possibly wrong but usually right!node xml2::xml_nodeverbose logicalprefix xpath namespace prefix,NA or NULL or charcater()to ignoretries numeric number of requests attempts before failingencoding character,by default’UTF-8’base_url character,the base URL for the serviceMethodsPublic methods:•ThreddsNode$new()•ThreddsNode$print()•ThreddsNode$GET()•ThreddsNode$browse()•ThreddsNode$children_names()•ThreddsNode$clone()Method new():initialize an instance of ThreddsNodeUsage:ThreddsNode$new(x,verbose=FALSE,n_tries=3,prefix=NULL,ns_strip=FALSE,encoding="UTF-8",base_url="")Arguments:x url or xml2::xml_nodeverbose logical,TRUE to be noisy(default FALSE)n_tries numeric,defaults to3prefix character,the namespace to examine(default NULL,inherited when initialized)ns_strip logical,if TRUE then strip namespace(default FALSE)encoding character,by default’UTF-8’base_url character,the base URL for the serviceMethod print():print methodUsage:ThreddsNode$print(prefix="",...)Arguments:prefix character,to be printed before each line of output(like spaces)...other argum,ents(ignored for now)Method GET():Retrieve a node of the contents at this nodes URLUsage:ThreddsNode$GET()Returns:ThreddsNode or subclass or NULLMethod browse():Browse the URL if possibleUsage:ThreddsNode$browse()Method children_names():Retrieve a vector of unique child namesUsage:ThreddsNode$children_names(...)Arguments:...further arguments for xml_children_namesReturns:a vector of zero or more child namesMethod clone():The objects of this class are cloneable with this method.Usage:ThreddsNode$clone(deep=FALSE)Arguments:deep Whether to make a deep clone.NoteAbstract class.For examples see CatalogNode14xml_children_names xmlString Convert xm2::xml_node to characterDescriptionConvert xm2::xml_node to characterUsagexmlString(x)Argumentsx xmlNodeValuecharacterxml_children_names Get the names of childrenDescriptionGet the names of childrenUsagexml_children_names(x,unique_only=TRUE)Argumentsx xml2::xml_nodeunique_only logical if TRUE remove duplicatesValuezero or more child names.xml_id15 xml_id Retrieve an ID value for a node from it’s attributes.DescriptionRetrieve an ID value for a node from it’s attributes.Usagexml_id(x,atts=c("name","title","ID","urlPath","href"))Argumentsx xml node or a named character vector as per xml_attrsatts character,ordered vector of attribute names to use as an ID value As the list is stepped through if an attribute is missing or empty character then advance to thenext,otherwise return that valueValuecharacter identifier,possibly an empty character(character())Indexbuild_xpath,2CatalogNode,2,8,11,13DatasetNode,6get_catalog,8get_xml_ns,8grepl_it,9is_xmlNode,9parse_node,10ServiceNode,10thredds,11thredds-package(thredds),11thredds::ThreddsNode,2,6,10 ThreddsNode,12xml_children_names,13,14xml_id,15xml_ns,8xmlString,1416。

rbiouml包介绍说明书

rbiouml包介绍说明书

Package‘rbiouml’October14,2022Type PackageTitle Interact with BioUML ServerVersion1.11Date2021-08-10Description Functions for connecting to BioUML server,querying BioUML repository and launch-ing BioUML analyses.Maintainer Ivan Yevshin<************>License GPL-2Depends RCurl,RJSONIONeedsCompilation noAuthor Ivan Yevshin[aut,cre],Tagir Valeev[aut]Repository CRANDate/Publication2021-08-1009:00:02UTCR topics documented:biouml.analysis (2)biouml.analysis.list (2)biouml.analysis.parameters (3)biouml.export (3)biouml.export.parameters (4)biouml.exporters (4)biouml.get (5)biouml.import (5)biouml.import.parameters (6)biouml.importers (6) (7)biouml.job.wait (7)biouml.login (8)biouml.logout (9)biouml.ls (9)12biouml.analysis.list biouml.put (10)biouml.workflow (10)Index12 biouml.analysis Run BioUML analysisDescriptionRun BioUML analysis optionaly tracking progressUsagebiouml.analysis(analysisName,parameters=list(),wait=T,verbose=T)ArgumentsanalysisName name of BioUML analysis to run,use biouml.analysis.list to get the list of possible valuesparameters list of parameters to BioUML analysis,use biouml.analysis.parameters to get the list of parameterswait whether to wait for analysis completion or return immediatelyverbose print messages and progress from BioUML analysis,only meaningful if wait is TRUEValueJob id that can be passed to and biouml.job.waitbiouml.analysis.list List available BioUML analysesDescriptionbiouml.analysis.list fetches list of available analyses from current BioUML serverUsagebiouml.analysis.list()ValueA data frame(data.frame)with two column’Group’and’Name’.biouml.analysis.parameters3 biouml.analysis.parametersGet BioUML analysis parametersDescriptionGet BioUML analysis parameters names and descriptionUsagebiouml.analysis.parameters(analysisName)ArgumentsanalysisName name of BioUML analysis,,use biouml.analysis.list to get the list of pos-sible valuesValueA data frame(data.frame)with s corresponding to parameter names and one column’description’with parameter descriptionbiouml.export Export data from BioUMLDescriptionbiouml.export exports data from BioUML server to localfile in given formatUsagebiouml.export(path,exporter="Tab-separated text(*.txt)",exporter.params=list(),target.file="biouml.out") Argumentspath path in BioUML repositoryexporter character string specifying format,biouml.exporters provides possible values exporter.paramslist of parameters to exportertarget.file a character string naming afile to export toValueNone(invisible NULL).4biouml.exporters biouml.export.parametersGet BioUML export parametersDescriptionGet BioUML export parametersUsagebiouml.export.parameters(path,exporter)Argumentspath path to data element in BioUML repository to exportexporter name of BioUML exporter,use biouml.exporters to get the list of possible valuesValueA data frame(data.frame)with s corresponding to parameter names and one column’description’with parameter descriptionbiouml.exporters List BioUML exportersDescriptionbiouml.exporters fetches the list of exporters from BioUML server,these exporters can be used in biouml.export functionUsagebiouml.exporters()ValueCharacter vector of BioUML exporters.biouml.get5 biouml.get Fetch BioUML tableDescriptionbiouml.get fetches table data from BioUML serverUsagebiouml.get(path)Argumentspath Path to table in BioUML repositoryValueA data frame(data.frame)representation of BioUML table from path.Examples##Not run:##fetch table from public BioUML serverbiouml.login("https://")x<-biouml.get("data/Examples/Optimization/Data/Experiments/exp_data_1")head(x)biouml.logout()##End(Not run)biouml.import Importfile to BioUMLDescriptionbiouml.import importsfile to BioUML repositoryUsagebiouml.import(file,parentPath,importer,importer.params=list())Argumentsfile The name offile to importparentPath Path to folder in BioUML repositoryimporter character string specifying format,biouml.importers provides list of posible valuesimporter.paramslist of parameters to exporter6biouml.importersValueResulting path in BioUML repositorybiouml.import.parametersGet BioUML import parametersDescriptionGet BioUML import parametersUsagebiouml.import.parameters(path,importer)Argumentspath path to data element in BioUML repository to importimporter name of BioUML importer,use biouml.importers to get the list of possible valuesValueA data frame(data.frame)with s corresponding to parameter names and one column’description’with parameter descriptionbiouml.importers List BioUML importersDescriptionbiouml.importers fetches the list of importers from BioUML server,these importers can be used in biouml.import functionUsagebiouml.importers()ValueCharacter vector of BioUML importers.7 Fetch BioUML job infoDescription fetches info about BioUML jobUsage(jobID)ArgumentsjobID ID of job usually returned from biouml.analysisValueA list with following entriesstatus job status,one of’CREATED’,’RUNNING’,’PAUSED’,’COMPLETED’,’TER-MINATED_BY_REQUEST’,’TERMINATED_BY_ERROR’results a list of resulting paths in BioUML repositoryvalues character vector of messages from jobpercent percent completebiouml.job.wait Wait for job completionDescriptionbiouml.job.wait waits for BioUML job completionUsagebiouml.job.wait(jobID,verbose=T)ArgumentsjobID ID of job usually returned from biouml.analysisverbose print messages and progress from BioUML job8biouml.loginValueA list with following entriesstatus job status,one of’CREATED’,’RUNNING’,’PAUSED’,’COMPLETED’,’TER-MINATED_BY_REQUEST’,’TERMINATED_BY_ERROR’results a list of resulting paths in BioUML repositoryvalues character vector of messages from jobpercent percent completebiouml.login Login to BioUML serverDescriptionLogin to BioUML server.The connection will be saved in global options under name biouml_connection for future reuse.Usagebiouml.login(url= http://localhost:8080/biouml ,user= ,pass= )Argumentsurl URL of running biouml serveruser BioUML user,empty string for anonymous loginpass passwordValueInvisible connection to BioUML server,connection is a list with following items:user the name of user used for connectionpass password in plain texturl URL of biouml serversessionId session id returned by BioUML serverExamples##Not run:##connect to public BioUML server at https://biouml.login("https://")getOption("biouml_connection")biouml.logout()##End(Not run)biouml.logout9 biouml.logout Logout from BioUML serverDescriptionLogouts from BioUML serverUsagebiouml.logout()biouml.ls List data elements by pathDescriptionbiouml.ls lists children data elements by path in BioUML repositoryUsagebiouml.ls(path,extended=F)Argumentspath Path to data collection in BioUML repositoryextended whether to return additional attributes for each childrenValueIf extended is FALSE a character vector with child names,otherwise a data frame(data.frame) with s corresponding to child names and columns hasChildren and type.Examples##Not run:##list databases available in public BioUML serverbiouml.login("https://")biouml.ls("databases")biouml.logout()##End(Not run)10biouml.workflow biouml.put Put data.frame to BioUML repositoryDescriptionbiouml.put stores data.frame in BioUML repositoryUsagebiouml.put(path,value)Argumentspath Path in BioUML repositoryvalue data.frame to storeExamples##Not run:##put data.frame into BioUML repositoryx<-data.frame(A=1:10,B=LETTERS[1:10])biouml.login("https://")biouml.put("data/Collaboration/Demo/Data/Rtest/test_df",x)biouml.logout()##End(Not run)biouml.workflow Run BioUML workflowDescriptionRun BioUML workflow optionaly tracking progressUsagebiouml.workflow(path,parameters=list(),wait=T,verbose=T)Argumentspath path to BioUML workflowparameters list of parameters to BioUML workflowwait whether to wait for workflow completion or return immediatelyverbose print messages and progress from BioUML workflow,only meaningful if wait is TRUEbiouml.workflow11ValueJob id that can be passed to and biouml.job.waitIndexbiouml.analysis,2biouml.analysis.list,2,2,3biouml.analysis.parameters,2,3biouml.export,3,4biouml.export.parameters,4biouml.exporters,3,4,4biouml.get,5biouml.import,5,6biouml.import.parameters,6biouml.importers,5,6,6,2,7,11biouml.job.wait,2,7,11biouml.login,8biouml.logout,9biouml.ls,9biouml.put,10biouml.workflow,10data.frame,2–6,912。

rwicc包用户手册说明书

rwicc包用户手册说明书

Package‘rwicc’October14,2022Title Regression with Interval-Censored CovariatesVersion0.1.3Description Provides functions to simulate and analyze data for a regression model with an inter-val censored covariate,as described in Morrison et al.(2021)<doi:10.1111/biom.13472>. License MIT+file LICENSEEncoding UTF-8RoxygenNote7.1.2VignetteBuilder knitrConfig/testthat/edition3Imports biglm,dplyr,lubridate,magrittr,stats,pryr,arm,ggplot2,scalesSuggests spelling,rmarkdown,knitr,testthat,markdown,panderLanguage en-USURL https://d-morrison.github.io/rwicc/,https:///d-morrison/rwiccBugReports https:///d-morrison/rwicc/issuesNeedsCompilation noAuthor Douglas Morrison[aut,cre,cph](<https:///0000-0002-7195-830X>),Ron Brookmeyer[aut]Maintainer Douglas Morrison<********************>Repository CRANDate/Publication2022-03-0921:40:06UTCR topics documented:build_phi_function_from_coefs (2)compute_mu (2)fit_joint_model (3)12compute_mu fit_midpoint_model (5)fit_uniform_model (6)plot_CDF (7)plot_phi_curves (8)rwicc (10)seroconversion_inverse_survival_function (10)simulate_interval_censoring (11)Index13build_phi_function_from_coefsconvert a pair of simple logistic regression coefficients into P(Y|T)curve:Descriptionconvert a pair of simple logistic regression coefficients into P(Y|T)curve:Usagebuild_phi_function_from_coefs(coefs)Argumentscoefs numeric vector of coefficientsValuefunction(t)P(Y=1|T=t)compute_mu compute mean window period duration from simple logistic regressioncoefficientsDescriptioncompute mean window period duration from simple logistic regression coefficientsUsagecompute_mu(theta)Argumentstheta numeric vector of coefficientsValuenumeric scalar:mean window period durationfit_joint_model Fit a logistic regression model with an interval-censored covariateDescriptionThis functionfits a logistic regression model for a binary outcome Y with an interval-censored co-variate T,using an EM algorithm,as described in Morrison et al(2021);doi:10.1111/biom.13472. Usagefit_joint_model(participant_level_data,obs_level_data,model_formula=stats::formula(Y~T),mu_function=compute_mu,bin_width=1,denom_offset=0.1,EM_toler_loglik=0.1,EM_toler_est=1e-04,EM_max_iterations=Inf,glm_tolerance=1e-07,glm_maxit=20,initial_S_estimate_location=0.25,coef_change_metric="max abs rel diff coefs",verbose=FALSE)Argumentsparticipant_level_dataa data.frame or tibble with the following variables:•ID:participant ID•E:study enrollment date•L:date of last negative test for seroconversion•R:date offirst positive test for seroconversion•Cohort‘(optional):this variable can be used to stratify the modeling of theseroconversion distribution.obs_level_data a data.frame or tibble with the following variables:•ID:participant ID•O:biomarker sample collection dates•Y:MAA classifications(binary outcomes)model_formula the functional form for the regression model for p(y|t)(as a formula()object)mu_function a function taking a vector of regression coefficient estimates as input and out-putting an estimate of mu(mean duration of MAA-positive infection).bin_width the number of days between possible seroconversion dates(should be an integer) denom_offset an offset value added to the denominator of the hazard estimates to improve numerical stabilityEM_toler_loglikthe convergence cutoff for the log-likelihood criterion("Delta_L"in the paper) EM_toler_est the convergence cutoff for the parameter estimate criterion("Delta_theta"in the paper)EM_max_iterationsthe number of EM iterations to perform before giving up if still not converged.glm_tolerance the convergence cutoff for the glmfit in the M stepglm_maxit the iterations cutoff for the glmfit in the M stepinitial_S_estimate_locationdetermines how seroconversion date is guessed to initialize the algorithm;canbe any decimal between0and1;0.5=midpoint imputation,0.25=1st quartile,0=last negative,etc.coef_change_metrica string indicating the type of parameter estimate criterion to use:•"max abs rel diff coefs"is the"Delta_theta"criterion described in the paper.•"max abs diff coefs"is the maximum absolute change in the coefficients(not divided by the old values);this criterion can be useful when someparameters are close to0.•"diff mu"is the absolute change in mu,which may be helpful in the inci-dence estimate calibration setting but not elsewhere.verbose whether to print algorithm progress details to the consoleValuea list with the following elements:•Theta:the estimated regression coefficients for the model of p(Y|T)•Mu:the estimated mean window period(a transformation of Theta)•Omega:a table with the estimated parameters for the model of p(S|E).•converged:indicator of whether the algorithm reached its cutoff criteria before reaching the specified maximum iterations.1=reached cutoffs,0=not.•iterations:the number of EM iterations completed before the algorithm stopped.•convergence_metrics:the four convergence metricsReferencesMorrison,Laeyendecker,and Brookmeyer(2021)."Regression with interval-censored covariates: Application to cross-sectional incidence estimation".Biometrics.doi:10.1111/biom.13472.Examples##Not run:#simulate data:study_data<-simulate_interval_censoring()#fit model:EM_algorithm_outputs<-fit_joint_model(obs_level_data=study_data$obs_data,participant_level_data=study_data$pt_data)##End(Not run)fit_midpoint_model Fit model using midpoint imputationDescriptionFit model using midpoint imputationUsagefit_midpoint_model(participant_level_data,obs_level_data,maxit=1000,tolerance=1e-08)Argumentsparticipant_level_dataa data.frame or tibble with the following variables:•ID:participant ID•E:study enrollment date•L:date of last negative test for seroconversion•R:date offirst positive test for seroconversion•Cohort‘(optional):this variable can be used to stratify the modeling of theseroconversion distribution.obs_level_data a data.frame or tibble with the following variables:•ID:participant ID•O:biomarker sample collection dates•Y:MAA classifications(binary outcomes)maxit maximum iterations,passed to bigglmtolerance convergence criterion,passed to bigglm6fit_uniform_modelValuea vector of logistic regression coefficient estimatesExamplessim_data=simulate_interval_censoring("theta"=c(0.986,-3.88),"study_cohort_size"=4500,"preconversion_interval_length"=365,"hazard_alpha"=1,"hazard_beta"=0.5)theta_est_midpoint=fit_midpoint_model(obs_level_data=sim_data$obs_data,participant_level_data=sim_data$pt_data)fit_uniform_model Fit model using uniform imputationDescriptionFit model using uniform imputationUsagefit_uniform_model(participant_level_data,obs_level_data,maxit=1000,tolerance=1e-08,n_imputations=10)Argumentsparticipant_level_dataa data.frame or tibble with the following variables:•ID:participant ID•E:study enrollment date•L:date of last negative test for seroconversion•R:date offirst positive test for seroconversion•Cohort‘(optional):this variable can be used to stratify the modeling of theseroconversion distribution.obs_level_data a data.frame or tibble with the following variables:plot_CDF7•ID:participant ID•O:biomarker sample collection dates•Y:MAA classifications(binary outcomes)maxit maximum iterations,passed to bigglmtolerance convergence criterion,passed to bigglmn_imputations number of imputed data sets to createValuea vector of logistic regression coefficient estimatesExamplessim_data=simulate_interval_censoring("theta"=c(0.986,-3.88),"study_cohort_size"=4500,"preconversion_interval_length"=365,"hazard_alpha"=1,"hazard_beta"=0.5)theta_est_midpoint=fit_uniform_model(obs_level_data=sim_data$obs_data,participant_level_data=sim_data$pt_data)plot_CDF plot estimated and true CDFs for seroconversion date distributionDescriptionplot estimated and true CDFs for seroconversion date distributionUsageplot_CDF(true_hazard_alpha,true_hazard_beta,omega.hat)Argumentstrue_hazard_alphaThe data-generating hazard at the start of the studytrue_hazard_betaThe change in data-generating hazard per calendar yearomega.hat tibble of estimated discrete hazardsValuea ggplotExamples##Not run:hazard_alpha=1hazard_beta=0.5study_data<-simulate_interval_censoring("hazard_alpha"=hazard_alpha,"hazard_beta"=hazard_beta)#fit model:EM_algorithm_outputs<-fit_joint_model(obs_level_data=study_data$obs_data,participant_level_data=study_data$pt_data)plot1=plot_CDF(true_hazard_alpha=hazard_alpha,true_hazard_beta=hazard_beta,omega.hat=EM_algorithm_outputs$Omega)print(plot1)##End(Not run)plot_phi_curves Plot true and estimated curves for P(Y=1|T=t)DescriptionPlot true and estimated curves for P(Y=1|T=t)Usageplot_phi_curves(theta_true,theta.hat_joint,theta.hat_midpoint,theta.hat_uniform)Argumentstheta_true the coefficients of the data-generating model P(Y=1|T=t) theta.hat_jointthe estimated coefficients from the joint model theta.hat_midpointthe estimated coefficients from midpoint imputation theta.hat_uniformthe estimated coefficients from uniform imputationValuea ggplotExamples##Not run:theta_true=c(0.986,-3.88)hazard_alpha=1hazard_beta=0.5sim_data=simulate_interval_censoring("theta"=theta_true,"study_cohort_size"=4500,"preconversion_interval_length"=365,"hazard_alpha"=hazard_alpha,"hazard_beta"=hazard_beta)#extract the participant-level and observation-level simulated data: sim_participant_data=sim_data$pt_datasim_obs_data=sim_data$obs_datarm(sim_data)#joint model:EM_algorithm_outputs=fit_joint_model(obs_level_data=sim_obs_data,participant_level_data=sim_participant_data,bin_width=7,verbose=FALSE)#midpoint imputation:theta_est_midpoint=fit_midpoint_model(obs_level_data=sim_obs_data,participant_level_data=sim_participant_data)#uniform imputation:theta_est_uniform=fit_uniform_model(obs_level_data=sim_obs_data,participant_level_data=sim_participant_data)plot2=plot_phi_curves(theta_true=theta_true,theta.hat_uniform=theta_est_uniform,theta.hat_midpoint=theta_est_midpoint,theta.hat_joint=EM_algorithm_outputs$Theta)print(plot2)##End(Not run)10seroconversion_inverse_survival_function rwicc rwicc:Regression with Interval-Censored CovariatesDescriptionThe rwicc package implements a regression model with an interval-censored covariate using an EM algorithm,as described in Morrison et al(2021);doi:10.1111/biom.13472.rwicc functionsThe main rwicc functions are:•simulate_interval_censoring•fit_joint_modelReferencesMorrison,Laeyendecker,and Brookmeyer(2021)."Regression with interval-censored covariates: Application to cross-sectional incidence estimation".Biometrics.doi:10.1111/biom.13472.seroconversion_inverse_survival_functionInverse survival function for time-to-event variable with linear hazardfunctionDescriptionThis function determines the seroconversion date corresponding to a provided probability of sur-vival.See doi:10.1111/biom.13472,Supporting Information,Section A.4.Usageseroconversion_inverse_survival_function(u,e,hazard_alpha,hazard_beta)Argumentsu a vector of seroconversion survival probabilitiese a vector of time differences between study start and enrollment(in years)hazard_alpha the instantaneous hazard of seroconversion on the study start datehazard_beta the change in hazard per year after study start dateValuenumeric vector of time differences between study start and seroconversion(in years)ReferencesMorrison,Laeyendecker,and Brookmeyer(2021)."Regression with interval-censored covariates: Application to cross-sectional incidence estimation".Biometrics,doi:10.1111/biom.13472.simulate_interval_censoringSimulate a dataset with interval-censored seroconversion datesDescriptionsimulate_interval_censoring generates a simulated data set from a data-generating model based on the typical structure of a cohort study of HIV biomarker progression,as described in Morrison et al(2021);doi:10.1111/biom.13472.Usagesimulate_interval_censoring(study_cohort_size=4500,hazard_alpha=1,hazard_beta=0.5,preconversion_interval_length=84,theta=c(0.986,-3.88),probability_of_ever_seroconverting=0.05,years_in_study=10,max_scheduling_offset=7,days_from_study_start_to_recruitment_end=365,study_start_date=lubridate::ymd("2001-01-01"))Argumentsstudy_cohort_sizethe number of participants to simulate(N_0in the paper)hazard_alpha the hazard(instantaneous risk)of seroconversion at the start date of the cohort study for those participants at risk of seroconversionhazard_beta the change in hazard per calendar yearpreconversion_interval_lengththe number of days between tests for seroconversiontheta the parameters of a logistic model(with linear functional from)specifying the probability of MAA-positive biomarkers as a function of time since seroconver-sionprobability_of_ever_seroconvertingthe probability that each participant is at risk of HIV seroconversion years_in_study the duration of follow-up for each participantmax_scheduling_offsetthe maximum divergence of pre-seroconversion followup visits from the pre-scribed scheduledays_from_study_start_to_recruitment_endthe length of the recruitment periodstudy_start_datethe date when the study starts recruitment("d_0"in the main text).The valueof this parameter does not affect the simulation results;it is only necessary as areference point for generating E,L,R,O,and S.ValueA list containing the following two tibbles:•pt_data:a tibble of participant-level information,with the following columns:–ID:participant ID–E:enrollment date–L:date of last HIV test prior to seroconversion–R:date offirst HIV test after seroconversion•obs_data:a tibble of longitudinal observations with the following columns:–ID:participant ID–O:dates of biomarker sample collection–Y:MAA classifications of biomarker samplesReferencesMorrison,Laeyendecker,and Brookmeyer(2021)."Regression with interval-censored covariates: Application to cross-sectional incidence estimation".Biometrics.doi:10.1111/biom.13472. Examplesstudy_data<-simulate_interval_censoring()participant_characteristics<-study_data$pt_datalongitudinal_observations<-study_data$obs_dataIndexbuild_phi_function_from_coefs,2compute_mu,2fit_joint_model,3,10fit_midpoint_model,5fit_uniform_model,6plot_CDF,7plot_phi_curves,8rwicc,10seroconversion_inverse_survival_function, 10simulate_interval_censoring,10,1113。

enrichR包说明说明书

enrichR包说明说明书

Package‘enrichR’April14,2023Title Provides an R Interface to'Enrichr'Version3.2Description Provides an R interface to all'Enrichr'databases.'Enrichr'is a web-based tool for analysing gene sets and returns any enrichment of common annotated biologi-cal features.Quoting from their website'Enrichment analysis is a computational method for in-ferring knowledge about an input gene set by comparing it to annotated gene sets represent-ing prior biological knowledge.'See<https://maayanlab.cloud/Enrichr/>for further de-tails.Depends R(>=3.0.0)License GPL(>=2)Encoding UTF-8LazyData trueImports httr,curl,rjson,ggplot2,WriteXLSRoxygenNote7.2.3Suggests knitr,rmarkdownVignetteBuilder knitrNeedsCompilation noAuthor Wajid Jawaid[aut,cre]Maintainer Wajid Jawaid<****************>Repository CRANDate/Publication2023-04-1409:30:02UTCR topics documented:enrichR-package (2).onAttach (2)enrichr (3)genes790 (4)getEnrichr (4)listEnrichrDbs (5)listEnrichrSites (5)12.onAttachplotEnrich (6)printEnrich (7)setEnrichrSite (8)Index10 enrichR-package enrichR packageDescriptionThe enrichR package provides an R interface to all enrichR(https://maayanlab.cloud/Enrichr/) databases.Author(s)Wajid Jawaid<****************>.onAttach onLoad hook to setup package optionsDescriptiononLoad hook to setup package optionsUsage.onAttach(libname,pkgname)Argumentslibname(Required).Library namepkgname(Required).Package nameDetailsonLoad hook to setup package options and to check connection to websiteAuthor(s)Wajid Jawaid<****************>enrichr3 enrichr Gene enrichment using EnrichrDescriptionGene enrichment using EnrichrUsageenrichr(genes,databases=NULL)Argumentsgenes(Required).Character vector of gene names or data.frame of gene names in infirst column and a score between0and1in the other.databases(Required).Character vector of databases to search.See https://maayanlab.cloud/Enrichr/ for available databases.DetailsGene enrichment using EnrichrValueReturns a list of data.frame of enrichment terms,p-values,...Author(s)Wajid Jawaid<****************>Examplesdbs<-listEnrichrDbs()dbs<-c("GO_Molecular_Function_2018","GO_Cellular_Component_2018","GO_Biological_Process_2018")enriched<-enrichr(c("Runx1","Gfi1","Gfi1b","Spi1","Gata1","Kdr"),dbs)4getEnrichr genes790790gene symbolsDescriptionThis is a character vector which consists of randomly selected790genes.FormatvectorExamplesdata(genes790)length(genes790)getEnrichr Helper function for GETDescriptionHelper functionUsagegetEnrichr(url,...)Argumentsurl(Required).URL address requested...(Optional).Additional parameters to pass to GETDetailsHelper function for GETValuesame as GETAuthor(s)Wajid Jawaid<****************>I-Hsuan Lin<*************************.uk>listEnrichrDbs5 listEnrichrDbs Look up available databases on EnrichrDescriptionLook up available databases on EnrichrUsagelistEnrichrDbs()DetailsLook up available databases on EnrichrValueA data.frame of available Enrichr databasesAuthor(s)Wajid Jawaid<****************>Examplesdbs<-listEnrichrDbs()listEnrichrSites List Enrichr WebsitesDescriptionList modEnrichr WebsitesUsagelistEnrichrSites(...)Arguments...(Optional Additional parameters)DetailsList Enrichr Websites6plotEnrichValueprint Enrichr Website statusAuthor(s)Alexander BlumeplotEnrich plotEnrichDescriptionVisualise a Enrichr output as barplotUsageplotEnrich(df,showTerms=20,numChar=40,y="Count",orderBy="P.value",xlab=NULL,ylab=NULL,title=NULL)Argumentsdf(Required).A single data.frame from a list of Enrichr output.showTerms(Optional).Number of terms to show.Default is20.numChar(Optional).A single integer.Default is40.Indicates the number characters to keep in the term description.y(Optional).A character string.Default is"Count".Indicates the variable that should be mapped to the y-axis.It can be either"Count"or"Ratio".orderBy(Optional).A character string.Default is"P.value".Indicates how to order the Enrichr results before subsetting to keep top N terms.It can be either"P.value"or"Combined.Score".xlab(Optional).A character string.Default is NULL.Indicates the x-axis label.ylab(Optional).A character string.Default is NULL.Indicates the y-axis label.title(Optional).A character string.Default is NULL Indicates the main title for the graphic.DetailsVisualise Enrichr result from a selected gene-set library as barplot.printEnrich7 ValueA ggplot2plot objectAuthor(s)I-Hsuan Lin<*************************.uk>See AlsoggplotExamplesif(getOption("enrichR.live")){dbs<-listEnrichrDbs()enrichRLive<-TRUEif(is.null(dbs))enrichRLive<-FALSEdbs<-c("GO_Molecular_Function_2018","GO_Cellular_Component_2018","GO_Biological_Process_2018")enriched<-enrichr(c("Runx1","Gfi1","Gfi1b","Spi1","Gata1","Kdr"),dbs)#Plot top20terms from"GO_Biological_Process_2018"and ordered by P-valueif(enrichRLive){plotEnrich(enriched[[3]],showTerms=20,numChar=50,y="Count",orderBy="P.value")}}printEnrich printEnrichDescriptionPrint Enrichr resultsUsageprintEnrich(data,prefix="enrichr",showTerms=NULL,columns=c(1:9),write2file=TRUE,outFile=c("txt","excel"))Argumentsdata(Required).Output list object from the"enrichr"function.prefix(Optional).Prefix of outputfile.Default is"enrichr".showTerms(Optional).Number of terms to show.Default is NULL to print all terms.columns(Optional).Columns from each entry of data.Default is c(1:9)to print allcolumns.1-"Term",2-"Overlap",3-"P.value",4-"Adjusted.P.value"5-"Old.P.value",6-"Old.Adjusted.P.value"7-"Odds.Ratio"8-"Combined.Score"9-"Combined.Score"write2file(Optional).Set to TRUE if you would like this functino to output afileoutFile(Optional).Outputfile format,choose from"txt"and"excel".Default is"txt".DetailsPrint Enrichr results from the selected gene-set libraries to individual textfiles.Author(s)Wajid Jawaid<****************>I-Hsuan Lin<*************************.uk>Examplesif(getOption("enrichR.live")){enrichRLive<-TRUEdbs<-listEnrichrDbs()if(is.null(dbs))enrichRLive<-FALSEdbs<-c("GO_Molecular_Function_2018","GO_Cellular_Component_2018","GO_Biological_Process_2018")enriched<-enrichr(c("Runx1","Gfi1","Gfi1b","Spi1","Gata1","Kdr"),dbs)if(enrichRLive)printEnrich(enriched,write2file=FALSE)}setEnrichrSite Set Enrichr WebsiteDescriptionSet Enrichr WebsiteUsagesetEnrichrSite(site)Argumentssite site requestedDetailsSet Enrichr WebsiteValueChanges Enrichr Website connection Author(s)Alexander BlumeIndex∗datasetsgenes790,4∗packageenrichR-package,2.onAttach,2enrichr,3enrichR-package,2genes790,4getEnrichr,4ggplot,7listEnrichrDbs,5listEnrichrSites,5plotEnrich,6printEnrich,7setEnrichrSite,810。

Twitter数据获取与情感分析工具包说明书

Twitter数据获取与情感分析工具包说明书

Package‘tsentiment’November2,2022Type PackageTitle Fetching Tweet Data for Sentiment AnalysisVersion1.0.5Author Hakki Sabah<**********************>Maintainer Hakki Sabah<**********************>Description Which uses Twitter APIs for the necessary data in sentiment analysis,acts as a middle-ware with the approved Twitter Application.A special access key is given to users who subscribe to the application with their Twitter ac-count.With this special access key,the user defined keyword for sentiment analy-sis can be searched in twitter recent searches and results can be obtained(more informa-tion<https:///hakkisabah/tsentiment>).In addition,a service named tsentiment-services has been developed to provide all these operations(for more information<https: ///hakkisabah/tsentiment-services>).After the successful results obtained and in line with the permissions given by the user,the re-sults of the analysis of the word cloud and bar graph saved in the user folder direc-tory can be seen.In each analysis performed,the previous analysis visual re-sult is deleted and this is the basic information you need to know as a practice rule.'tsentiment'package provides a free service that acts as a middleware for easy data extrac-tion from Twitter,and in return,the user rate limit is reduced by30requests from the to-tal limit and the remaining requests are used.These30requests are reserved for use in applica-tion analytics.For information about endpoints,you can refer to the limit informa-tion in the``GET search/tweets''row in the Endpoints column in the list at<https:///en/docs/twitter-api/v1/rate-limits>.License MIT+file LICENSEEncoding UTF-8URL https:///hakkisabah/tsentiment,https://BugReports https:///hakkisabah/tsentiment/issuesDepends R(>=4.0)Imports grDevices,reshape2,wordcloud,ggplot2,httr,syuzhet,tidytext,dplyr,tibble,stringi RoxygenNote7.2.112APIinfoNeedsCompilation noRepository CRANDate/Publication2022-11-0222:10:02UTCR topics documented:APIinfo (2)checkConfirmForUSer (3)checkVersionForSentiment (3)cleanFetchedTweet (4)clearPrevious (4)createFolder (4)getAnalysis (5)getBarSentiment (5)getCloudSentiment (6)getTweet (6)setAccount (7)tweetFetcher (7)writeToCSV (8)Index9 APIinfo tsentiment environmentDescriptiontsentiment environmentUsageAPIinfoArgumentsAPIinfo EnvironmentFormatAn object of class environment of length4.checkConfirmForUSer3 checkConfirmForUSer Userfile permission checkerDescriptionUserfile permission checkerUsagecheckConfirmForUSer()ValueStringExamples##Not run:checkConfirmForUser()##End(Not run)checkVersionForSentimentCheck r VersionDescriptionThis function checking using current R versionUsagecheckVersionForSentiment()ValuebooleanExamplescheckVersionForSentiment()4createFolder cleanFetchedTweet Clean raw dataDescriptionThis function clean fetched tweetsUsagecleanFetchedTweet(fetchedTweet=NULL)ArgumentsfetchedTweet Fetched tweet has a lot of different charactersValuetableclearPrevious Help for delete savefiles folderDescriptionHelp for delete savefiles folderUsageclearPrevious()ValueV oidcreateFolder Folder creatorDescriptionThis function create a folder in project pathUsagecreateFolder()ValueStringgetAnalysis5 getAnalysis Start analysis after defined Twitter API informationDescriptionThis function prepare API information and start analysisUsagegetAnalysis()ValuefileExamples##Not run:clearPrevious()getCloudSentiment()getBarSentiment()##End(Not run)getBarSentiment Export bar plotDescriptionThis function export a bar plot with analysed dataUsagegetBarSentiment(tweet=NULL)Argumentstweet Cleaned tweet dataValuefile6getTweet getCloudSentiment Export word cloudDescriptionThis function export a word cloud with analysed dataUsagegetCloudSentiment(text)Argumentstext Cleaned tweet dataValuefilegetTweet Get TweetDescriptionThis function only get tweet from tsentiment apiUsagegetTweet(fetchParams)ArgumentsfetchParams is variableValueJSONExamples##Not run:fetchParams<-list(headers=headers,params=params,url=APIinfo$url)getTweet(fetchParams)##End(Not run)setAccount7 setAccount Set Twitter Developer Account Api InformationDescriptionThis function should be used at the start of each sessionUsagesetAccount(params)Argumentsparams Its have to required Twitter and request informations for using this packageValueStringExamplesparams<-list(BEARER_TOKEN="DSEFS55SSS",query="binance")setAccount(params)tweetFetcher Fetch TweetsDescriptionThis function prepare http information for fetching process and working together sub functionUsagetweetFetcher()Valuelist8writeToCSV writeToCSV Create CSVDescriptionThis function create CSVfile with parametersUsagewriteToCSV(tweetData)ArgumentstweetData fetchedfirst dirty tweet dataValuefileExamples##Not run:writeToCSV()##End(Not run)Index∗datasetsAPIinfo,2APIinfo,2checkConfirmForUSer,3 checkVersionForSentiment,3 cleanFetchedTweet,4clearPrevious,4createFolder,4getAnalysis,5getBarSentiment,5getCloudSentiment,6getTweet,6setAccount,7tweetFetcher,7writeToCSV,89。

trimr包用户指南说明书

trimr包用户指南说明书

Package‘trimr’October14,2022Version1.1.1Date2022-05-03Title An Implementation of Common Response Time Trimming MethodsDescription Provides various commonly-used response time trimmingmethods,including the recursive/moving-criterion methods reported byVan Selst and Jolicoeur(1994).By passing trimming functions raw datafiles,the package will return trimmed data ready for inferential testing.Depends R(>=4.0)Imports stats,dplyrLicense GPL-3LazyData trueURL https:///JimGrange/trimrBugReports https:///JimGrange/trimr/issuesSuggests knitr,rmarkdownVignetteBuilder knitrRoxygenNote7.1.1NeedsCompilation noAuthor James Grange[cre,aut],Ed Berry[ctb]Maintainer James Grange<********************>Repository CRANDate/Publication2022-05-0502:20:02UTCR topics documented:absoluteRT (2)exampleData (3)hybridRecursive (4)linearInterpolation (5)12absoluteRT modifiedRecursive (5)nonRecursive (7)sdTrim (8)Index10 absoluteRT Absolute RT trimmingDescriptionabsoluteRT takes a data frame of RT data and returns trimmed rt data that fall between set minimum and maximum limits.UsageabsoluteRT(data,minRT,maxRT,pptVar="participant",condVar="condition",rtVar="rt",accVar="accuracy",omitErrors=TRUE,returnType="mean",digits=3)Argumentsdata A data frame with columns containing:participant identification number(’ppt-Var’);condition identification,if applicable(’condVar’);response time data(’rt-Var’);and accuracy(’accVar’).The RT can be in seconds(e.g.,0.654)or mil-liseconds(e.g.,654).Typically,"condition"will consist of strings.Accuracymust be coded as1for correct and0for error responses.minRT The lower criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).maxRT The upper criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).pptVar The quoted name of the column in the data that identifies participants.condVar The quoted name of the column in the data that includes the conditions.rtVar The quoted name of the column in the data containing reaction times.accVar The quoted name of the column in the data containing accuracy,coded as0or1 for incorrect and correct trial,respectively.exampleData3 omitErrors If set to TRUE,error trials will be removed before conducting trimming proce-dure.Final data returned will not be influenced by errors in this case.returnType Request nature of returned data."raw"returns trial-level data excluding trimmed data;"mean"returns mean response times per participant for each experimentalcondition identified;"median"returns median response times per participant foreach experimental condition identified.digits How many decimal places to round to after trimming?DetailsBy passing a data frame containing raw response time data,together with trimming criteria,the function will return trimmed data,either in the form of trial-level data or in the form of means/medians for each subject&condition.Examples#load the example data that ships with trimrdata(exampleData)#perform the trimming,returning mean RTtrimmedData<-absoluteRT(data=exampleData,minRT=150,maxRT=2500,returnType="mean")exampleData Example response time data setDescriptionAn example data set containing multiple participants’data for a response time study involving two experimental conditions.The data set also includes This is a synthetic data set and has no theoretical basis.UsageexampleDataFormatA data frame with20518rows and4variables:participant participant identification numbercondition the experimental condition(2in this example)rt response time,coded in millisecondsaccuracy accuracy of the response;1=correct,0=error4hybridRecursive hybridRecursive hybridRecursive trimming procedure.DescriptionhybridRecursive takes a data frame of RT data and returns trimmed rt data.The returned value is the average returned from the nonRecursive and the modifiedRecursive procedures as described in van Selst&Jolicoeur(1994).UsagehybridRecursive(data,minRT,pptVar="participant",condVar="condition",rtVar="rt",accVar="accuracy",omitErrors=TRUE,digits=3)Argumentsdata A data frame with columns containing:participant identification number(’ppt-Var’);condition identification,if applicable(’condVar’);response time data(’rt-Var’);and accuracy(’accVar’).The RT can be in seconds(e.g.,0.654)or mil-liseconds(e.g.,654).Typically,"condition"will consist of strings.Accuracymust be coded as1for correct and0for error responses.minRT The lower criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).All RTs below thisvalue are removed before proceeding with SD trimming.pptVar The quoted name of the column in the data that identifies participants.condVar The quoted name of the column in the data that includes the conditions.rtVar The quoted name of the column in the data containing reaction times.accVar The quoted name of the column in the data containing accuracy,coded as0or1 for incorrect and correct trial,respectively.omitErrors If set to TRUE,error trials will be removed before conducting trimming proce-dure.Final data returned will not be influenced by errors in this case.digits How many decimal places to round to after trimming?ReferencesVan Selst,M.&Jolicoeur,P.(1994).A solution to the effect of sample size on outlier elimination.Quarterly Journal of Experimental Psychology,47(A),631-650.linearInterpolation5 Examples#load the example data that ships with trimrdata(exampleData)#perform the trimming,returning mean RTtrimmedData<-hybridRecursive(data=exampleData,minRT=150)linearInterpolation SDs used for the recursive/moving criterion trimming methodsDescriptionA data frame containing the SDs used for each sample size as trimming criterion for the nonRecur-sive function and the modifiedRecursive functionUsagelinearInterpolationFormatA data frame with97rows and3columns:sampleSize Sample size of the data set being passednonRecursive The standard deviation to use as the criterion for the nonRecursive functionmodifiedRecursive The standard deviation to use as the criterion for the modifiedRecursive func-tionmodifiedRecursive modifiedRecursive trimming procedure.DescriptionmodifiedRecursive takes a data frame of RT data and returns trimmed rt data that fall below a set standard deviation above the each participant’s mean for each condition,with the criterion changing as more trials are removed,as described in van Selst&Jolicoeur(1994).6modifiedRecursiveUsagemodifiedRecursive(data,minRT,pptVar="participant",condVar="condition",rtVar="rt",accVar="accuracy",omitErrors=TRUE,returnType="mean",digits=3)Argumentsdata A data frame with columns containing:participant identification number(’ppt-Var’);condition identification,if applicable(’condVar’);response time data(’rt-Var’);and accuracy(’accVar’).The RT can be in seconds(e.g.,0.654)or mil-liseconds(e.g.,654).Typically,"condition"will consist of strings.Accuracymust be coded as1for correct and0for error responses.minRT The lower criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).All RTs below thisvalue are removed before proceeding with SD trimming.pptVar The quoted name of the column in the data that identifies participants.condVar The quoted name of the column in the data that includes the conditions.rtVar The quoted name of the column in the data containing reaction times.accVar The quoted name of the column in the data containing accuracy,coded as0or1 for incorrect and correct trial,respectively.omitErrors If set to TRUE,error trials will be removed before conducting trimming proce-dure.Final data returned will not be influenced by errors in this case.returnType Request nature of returned data."raw"returns trial-level data excluding trimmed data;"mean"returns mean response times per participant for each experimentalcondition identified;"median"returns median response times per participant foreach experimental condition identified.digits How many decimal places to round to after trimming?ReferencesVan Selst,M.&Jolicoeur,P.(1994).A solution to the effect of sample size on outlier elimination.Quarterly Journal of Experimental Psychology,47(A),631-650.Examples#load the example data that ships with trimrdata(exampleData)nonRecursive7 #perform the trimming,returning mean RTtrimmedData<-modifiedRecursive(data=exampleData,minRT=150,returnType="mean")nonRecursive nonRecursive trimming procedure.DescriptionnonRecursive takes a data frame of RT data and returns trimmed rt data that fall below a set standard deviation above the each participant’s mean for each condition.The SD used for trimming is proportional to the number of trials in the data being passed,as described in van Selst&Jolicoeur (1994).UsagenonRecursive(data,minRT,pptVar="participant",condVar="condition",rtVar="rt",accVar="accuracy",omitErrors=TRUE,returnType="mean",digits=3)Argumentsdata A data frame with columns containing:participant identification number(’ppt-Var’);condition identification,if applicable(’condVar’);response time data(’rt-Var’);and accuracy(’accVar’).The RT can be in seconds(e.g.,0.654)or mil-liseconds(e.g.,654).Typically,"condition"will consist of strings.Accuracymust be coded as1for correct and0for error responses.minRT The lower criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).All RTs below thisvalue are removed before proceeding with SD trimming.pptVar The quoted name of the column in the data that identifies participants.condVar The quoted name of the column in the data that includes the conditions.rtVar The quoted name of the column in the data containing reaction times.accVar The quoted name of the column in the data containing accuracy,coded as0or1 for incorrect and correct trial,respectively.omitErrors If set to TRUE,error trials will be removed before conducting trimming proce-dure.Final data returned will not be influenced by errors in this case.returnType Request nature of returned data."raw"returns trial-level data excluding trimmed data;"mean"returns mean response times per participant for each experimentalcondition identified;"median"returns median response times per participant foreach experimental condition identified.digits How many decimal places to round to after trimming?ReferencesVan Selst,M.&Jolicoeur,P.(1994).A solution to the effect of sample size on outlier elimination.Quarterly Journal of Experimental Psychology,47(A),631-650.Examples#load the example data that ships with trimrdata(exampleData)#perform the trimming,returning mean RTtrimmedData<-nonRecursive(data=exampleData,minRT=150,returnType="mean")sdTrim RT trimming with standard deviation criterionDescriptionsdTrim takes a data frame of RT data and returns trimmed rt data that fall below a set set criterion (based on standard deviations above a particular mean).The criterion can be based on the mean of the whole set of data,based on the mean per experimental condition,based on the mean per participant,or based on the mean of each participant in each experimental condition.UsagesdTrim(data,minRT,sd,pptVar="participant",condVar="condition",rtVar="rt",accVar="accuracy",perCondition=TRUE,perParticipant=TRUE,omitErrors=TRUE,returnType="mean",digits=3)Argumentsdata A data frame with columns containing:participant identification number(’ppt-Var’);condition identification,if applicable(’condVar’);response time data(’rt-Var’);and accuracy(’accVar’).The RT can be in seconds(e.g.,0.654)or mil-liseconds(e.g.,654).Typically,"condition"will consist of strings.Accuracymust be coded as1for correct and0for error responses.minRT The lower criteria for acceptable response time.Must be in the same form as rt column in data frame(e.g.,in seconds OR milliseconds).All RTs below thisvalue are removed before proceeding with SD trimming.sd The upper criteria for standard deviation cut-off.pptVar The quoted name of the column in the data that identifies participants.condVar The quoted name of the column in the data that includes the conditions.rtVar The quoted name of the column in the data containing reaction times.accVar The quoted name of the column in the data containing accuracy,coded as0or1 for incorrect and correct trial,respectively.perCondition Set to TRUE if the user wishes the trimming to occur per condition of the ex-perimental design.perParticipant Set to TRUE if the user wishes the trimming to occur per participant.omitErrors If set to TRUE,error trials will be removed before conducting trimming proce-dure.Final data returned will not be influenced by errors in this case.returnType Request nature of returned data."raw"returns trial-level data excluding trimmed data;"mean"returns mean response times per participant for each experimentalcondition identified;"median"returns median response times per participant foreach experimental condition identified.digits How many decimal places to round to after trimming?DetailsBy passing a data frame containing raw response time data,together with trimming criteria,the function will return trimmed data,either in the form of trial-level data or in the form of means/medians for each subject&condition.Examples#load the example data that ships with trimrdata(exampleData)#perform the trimming with SD trimming per condition,returning mean RTtrimmedData<-sdTrim(data=exampleData,minRT=150,sd=2.5,perCondition=TRUE,perParticipant=FALSE,returnType="mean")Index∗datasetsexampleData,3linearInterpolation,5absoluteRT,2exampleData,3hybridRecursive,4linearInterpolation,5modifiedRecursive,5nonRecursive,7sdTrim,810。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

The boost PackageDecember10,2004Title Boosting Methods for Real and Simulated DataVersion1.0-0Author Marcel DettlingDescription Contains a collection of boosting methods,these are’BagBoost’,’LogitBoost’,’AdaBoost’and’L2Boost’,Maintainer Marcel Dettling,<dettling@>URL http://stat.ethz.ch/~dettlingLicense GPL2.0R topics documented:adaboost (1)bagboost (3)l2boost (4)learner (5)leukemia (5)logitboost (6)simulator (7)summarize (9)Index11 adaboost adaboostDescriptionAn implementation of the AdaBoost algorithm for binary classificationUsageadaboost(xlearn,ylearn,xtest,presel=200,mfinal=100)12adaboost Argumentsxlearn A(n x p)-matrix,where rows correspond to training instances and columns con-tain the predictor variables.ylearn A vector of length n containing the class labels,which need to be coded by0 and1.xtest A(m x p)-matrix,where rows correspond to test instances and columns contain the predictor variables.presel An integer,giving the number of features to be pre-selected according to the Wilcoxon test statistic.Default is presel=200features.If presel=0,no featurepreselection is carried out.mfinal An integer,the number of iterations for which boosting is run.Defaults to mfi-nal=100iterations.ValueThe function outputs an array,whose rows contain out-of-sample probabilities that the class labels are predicted as being of class1,for every boosting iteration.Author(s)Marcel DettlingReferenceso"Boosting for Tumor Classification with Gene Expression Data",Marcel Dettling and Peter Bühlmann.Bioinformatics(2003),V ol.19,p.1061–1069.o"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettlingExamplesdata(leukemia,package="boost")##Dividing the leukemia dataset into training and test dataxlearn<-leukemia.x[c(1:20,34:38),]ylearn<-leukemia.y[c(1:20,34:38)]xtest<-leukemia.x[21:33,]ytest<-leukemia.y[21:33]##Classification with adaboostfit<-adaboost(xlearn,ylearn,xtest,presel=50,mfinal=20)summarize(fit,ytest)bagboost3 bagboost bagboostDescriptionAn implementation of the BagBoost algorithm for binary classificationUsagebagboost(xlearn,ylearn,xtest,presel=200,mfinal=100,bag=50)Argumentsxlearn A(n x p)-matrix,where rows correspond to training instances and columns con-tain the predictor variables.ylearn A vector of length n containing the class labels,which need to be coded by0and1.xtest A(m x p)-matrix,where rows correspond to test instances and columns containthe predictor variables.presel An integer,giving the number of features to be pre-selected according to theWilcoxon test statistic.Default is presel=200features.If presel=0,no featurepreselection is carried out.mfinal An integer,the number of iterations for which boosting is run.Defaults to mfi-nal=100iterationsbag An integer,the number of bagging steps that shall be done to obtain the weaklearner.Defaults to bag=50bagging iterations.ValueThe function outputs an array,whose rows contain out-of-sample probabilities that the class labels are predicted as being of class1,for every boosting iteration.Author(s)Marcel DettlingReferenceso"Boosting for Tumor Classification with Gene Expression Data",Marcel Dettling and Peter Bühlmann.Bioinformatics(2003),V ol.19,p.1061–1069.o"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettling4l2boost Examplesdata(leukemia,package="boost")##Dividing the leukemia dataset into training and test dataxlearn<-leukemia.x[c(1:20,34:38),]ylearn<-leukemia.y[c(1:20,34:38)]xtest<-leukemia.x[21:33,]ytest<-leukemia.y[21:33]##Classification with bagboostfit<-bagboost(xlearn,ylearn,xtest,presel=50,mfinal=20,bag=5)summarize(fit,ytest)l2boost l2boostDescriptionAn implementation of the LogitBoost algorithm for binary classificationUsagel2boost(xlearn,ylearn,xtest,presel=200,mfinal=100)Argumentsxlearn A(n x p)-matrix,where rows correspond to training instances and columns con-tain the predictor variables.ylearn A vector of length n containing the class labels,which need to be coded by0 and1.xtest A(m x p)-matrix,where rows correspond to test instances and columns contain the predictor variables.presel An integer,giving the number of features to be pre-selected according to the Wilcoxon test statistic.Default is presel=200features.If presel=0,no featurepreselection is carried out.mfinal An integer,the number of iterations for which boosting is run.Defaults to mfi-nal=100iterationsValueThe function outputs an array,whose rows contain out-of-sample probabilities that the class labels are predicted as being of class1,for every boosting iteration.Author(s)Marcel Dettlinglearner5Referenceso"Boosting for Tumor Classification with Gene Expression Data",Marcel Dettling and Peter Bühlmann.Bioinformatics(2003),V ol.19,p.1061–1069.o"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettlingExamplesdata(leukemia,package="boost")##Dividing the leukemia dataset into training and test dataxlearn<-leukemia.x[c(1:20,34:38),]ylearn<-leukemia.y[c(1:20,34:38)]xtest<-leukemia.x[21:33,]ytest<-leukemia.y[21:33]##Classification with l2boostfit<-l2boost(xlearn,ylearn,xtest,presel=50,mfinal=20)summarize(fit,ytest)learner Internal functions for the boost package.DescriptionThese are not to be called by the user.See Alsosimulator,logitboost,bagboost,adaboost,l2boostleukemia A part of the famous AML/ALL-leukemia datasetDescriptionThis is the training set of the famous AML/ALL-leukemia dataset from the Whitehead Institute.It has been reduced to250genes,about the half of which are very informative for classification, whereas the other half was chosen randomly.Usagedata(leukemia)6logitboostFormatContains three R-objects:The expression matrix leukemia.x,the associated binary response vari-able leukemia.y,and the associated3-class response variable leukemia.zSource/MPRReferencesFirst published in Golub et al:Molecular Classification of Cancer:Class Discovery and Class Prediction by Gene Expression Monitoring.Science1999,286:531-538.Examplesdata(leukemia)str(leukemia.x)str(leukemia.y)str(leukemia.z)par(mfrow=c(1,2))plot(leukemia.x[,56],leukemia.y)plot(leukemia.x[,174],leukemia.z)logitboost logitboostDescriptionAn implementation of the LogitBoost algorithm for binary classificationUsagelogitboost(xlearn,ylearn,xtest,presel=200,mfinal=100)Argumentsxlearn A(n x p)-matrix,where rows correspond to training instances and columns con-tain the predictor variables.ylearn A vector of length n containing the class labels,which need to be coded by0 and1.xtest A(m x p)-matrix,where rows correspond to test instances and columns contain the predictor variables.presel An integer,giving the number of features to be pre-selected according to the Wilcoxon test statistic.Default is presel=200features.If presel=0,no featurepreselection is carried out.mfinal An integer,the number of iterations for which boosting is run.Defaults to mfi-nal=100iterationsValueThe function outputs an array,whose rows contain out-of-sample probabilities that the class labels are predicted as being of class1,for every boosting iteration.Author(s)Marcel DettlingReferenceso"Boosting for Tumor Classification with Gene Expression Data",Marcel Dettling and Peter Bühlmann.Bioinformatics(2003),V ol.19,p.1061–1069.o"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettlingExamplesdata(leukemia,package="boost")##Dividing the leukemia dataset into training and test dataxlearn<-leukemia.x[c(1:20,34:38),]ylearn<-leukemia.y[c(1:20,34:38)]xtest<-leukemia.x[21:33,]ytest<-leukemia.y[21:33]##Classification with logitboostfit<-logitboost(xlearn,ylearn,xtest,presel=50,mfinal=20)summarize(fit,ytest)simulator simulatorDescriptionSimulation of(microarray)data according to correlation and mean structures from real datasets. Usagesimulator(x,y,respmod=c("none","resp1","resp2","resp3"),nos=1200,gene=NULL,signs=NULL)Argumentsx A(n x p)-matrix,whose correlation and mean structure is to be used for simu-lating data.Its rows correspond to training instances and columns contain thepredictor variables.y A vector of length n containing the class labels,which need to be coded by0 and1.respmod A character string.Either"none"where the simulated gene expression labels are determined model-free depending which class mean and correlation struc-ture had been used for their determination.The choice of"resp1","resp2"and"resp3"means that a response model is applied.For"resp1",10genes are se-lected and determine conditional proabilities via a logistic model with equalweights.The class labels are then regarded as having a Bernoulli distributionwith probability p.For"resp2",25genes are plugged into the logistic modelwith non-equal weights.With"resp3",25genes are chosen for a logistic modelwith second and third order interactions.nos An integer,giving the number of instances which are simulated.gene A vector giving the index of the genes which shall be used for model based class label simulation.Defaults to NULL.This argument should only be usedfor specially designed simulation studies,where it is important that the samepredictor variables are repeatedly used for simulating class label.signs A vector containing entries of+1and-1.Defaults to NULL and is only of importance in specially designed simulation studies,where it is important thatthe same predictor variables are repeatedly used for simulating class label.DetailsThe new instances are simulated according to a multivariate normal distribution with means and correlation structure taken from a real(gene expression)dataset.This structure is obtained by transforming a standard multivariate normal distribution,which requires a eigenvalue decomposi-tion of the provided real dataset.For datasets with many predictors(>500),this can be fairly time consuming.Simulating data without applying a response model isfine for most purposes,only special analysis tasks usually require it.ValueReturns a list containingx An(nos x p)-matrix,containing the simulated datay A vector of length nos,containing the class labels of the simulated data.probab A vector of length nos,containing the conditional probabilities of the simulated data.Is empty if respmod="none".bayes An integer,giving the Bayes error(theoretically minimal misclassification risk) for the simulated data.Is empty if respmod="none".gene A vector,containing the indices of the variables which had been used in the lo-gistic model for either"resp1","resp2"or"resp3".Is empty if respmod="none".signs A vector,containing-1and+1.Indicates with what polarization a predictor variable had been used in the logistic model.Is empty if respmod="none".bReferenceso"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettlingExamplesset.seed(21)data(leukemia)##Simulation of gene expression datasimu<-simulator(leukemia.x,leukemia.y,nos=200)##Defining training and test dataxlearn<-simu$x[1:150,]ylearn<-simu$y[1:150]xtest<-simu$x[151:200,]ytest<-simu$y[151:200]##Classification with logitboostfit<-logitboost(xlearn,ylearn,xtest,mfinal=20,presel=50)summarize(fit,ytest)summarize Summarize the output of classification with boosting functionsDescriptionYields text and graphical output that summarizes the misclassifcation error rates that have been achieved with boosting methodsUsagesummarize(boost.out,resp,mout=ncol(boost.out),grafik=TRUE)Argumentsboost.out An R-object,as obtained from one of the functions’bagboost’,’logitboost’,’adaboost’or’l2boost’.resp A vector containing the class labels of the test instances.Needs to be coded by 0and1.mout The number of boosting iterations for which the error rate shall be printed.De-faults to the number of iterations boosting has been run for.grafik Logical,indicating whether a plot of the error rates is desired or not.ValueJust verbatim and graphical output.Author(s)Marcel DettlingReferenceso"Boosting for Tumor Classification with Gene Expression Data",Marcel Dettling and Peter Bühlmann.Bioinformatics(2003),V ol.19,p.1061–1069.o"BagBoosting for Tumor Classification with Gene Expression Data",Marcel Dettling.To appear in Bioinformatics(2005).o Further information is available from the webpage http://stat.ethz.ch/~dettlingSee Alsobagboost,logitboost,adaboost,l2boostExamplesdata(leukemia,package="boost")##Dividing the leukemia dataset into training and test dataxlearn<-leukemia.x[c(1:20,34:38),]ylearn<-leukemia.y[c(1:20,34:38)]xtest<-leukemia.x[21:33,]ytest<-leukemia.y[21:33]##Classification with logitboostfit<-logitboost(xlearn,ylearn,xtest,presel=50,mfinal=20)summarize(fit,ytest)Index∗Topic classifadaboost,1bagboost,2l2boost,3learner,5logitboost,6simulator,7summarize,9∗Topic datasetsleukemia,5adaboost,1bagboost,2l2boost,3learner,5leukemia,5logitboost,6response1(learner),5response2(learner),5response3(learner),5score(learner),5simulator,7summarize,911。

相关文档
最新文档