Replace 取代· Begin to Learn R - begin4learn

文章推薦指數: 80 %
投票人數:10人

如同在修訂文件時常用的取代功能,我們常需要在文字中將符合某些特徵或關鍵字的部分搜尋出來 ... R 語言中使用 ... 如何掌控資料:關於文字在Python 與R 語言處理文字 ... BegintoLearnR IntroductionR DataInput&Output DataInput匯入資料 DataOutput輸出資料 DatabaseInput讀取資料庫 Datasets DataWrangling Recode Addacolumn Factor Groupingbydaterange ReshapingData Reshaping:LongtoWidedcast(){reshape2} Reshaping:WidetoLongmelt(){reshape2} SortingResults StringManipulation Subset SummariesbySubgroups{plyr} EDA-ExploratoryDataAnalysis DataExploratory VariableIdentification UnivariateAnalysis IQRInterquartileRange FrequencyTable(Chart) FrequencyDistributionTable CumulativeFrequencyDistributionTable Stemplot Bi-variateAnalysis Missingvaluestreatment Outliertreatment FeatureEngineering Variabletransformation Variablecreation DataAnalysis RDataAnalysis GraphicalDataAnalysis FactorAnalysis PCA-PrincipalComponentsAnalysis DecisionTrees RandomForest Clustering Classification SVM-SupportVectorMachines NaïveBayesClassification BayesianStatistics BayesianMethods BayesianNetwork BayesianNetworksInference BayesianNetworkApplications Time-series RStatistics統計 DescriptiveStatistics Mean Mode Median IQRInterquartileRange 5-numbersummary Variance StandardDeviation Standarderror Inferentialstatistics ExpectedValue HypothesisTesting T-tests ANOVA Chi-SquareTest LinearRegression LinearModels NonlinearRegressionAnalysis LogisticRegression Generalizedlinearmodels(GLMs) MaximumLikelihoodEstimation(MLE) GeneralizedAdditiveModels(GAM) SurvivalAnalysis Distribution NormalDistribution NonNormalDistribution BinomialDistribution PoissonDistribution MachineLearning Unsupervisedlearning Supervisedlearning ReinforcementLearning SupportVectorMachine支持向量機 StructuralChangeandAnomaliesDetection Crawler網頁解析爬蟲 BinaryClassificationmetrics DataCommunication溝通資料 DataVisualization DataPrediction(Modeling) Case&Code FinanceR GenomicsR ClinicalResearch Commerce商業 RBasic Command {base} {stats} Syntax Arguments Packages Install&Setting Rinstall Rinstall_Ubuntu18 Rsetting Environment環境空間 Data DataStructures DataFrame資料框架 Create/Input ReferenceElements Modify Operations Output Function Example List列表 Create/Input ReferenceElements Modify Operations Output Function Example Vectors向量(1維) Create/Input ReferenceElements Modify Operations Output Function Example Matrices矩陣(2維) Create/Input ReferenceElements Modify Operations Output Function Example Array陣列(多維) Create/Input ReferenceElements Modify Operations Output Function Example xts:timeseriesdata Create/Input ReferenceElements Modify Operations Output Function Example DataTypes Numeric Operations Function Example Logical Operations Function Example Character文字型別 Operations文字操作 Create建立 Length量測長度 Case大小寫 Space空格 Output格式化輸出 Capture擷取 Date日期時間 Split分隔 Position位置 Replace取代 RegularExpression正規表達 ApplytoArray應用文字處理函數至陣列 Function Example Factor因子 Operations Function Example Dates Operations Function Example MissingData Operations Function Example Function Date Variable變數 DiscreteVariables ContinuousVariables QuantitativeVariables QualitativeVariables CategoricalVariable Loop if判斷式 switch單選 while-loop for-loop repeat-loop breakloop nextloop Graphics BasicGraphics BarChart Histogram Boxplot AdvancedGraphics PackageGraphics {ggplot2}a-z {ggplot2}optiona-z {graphics}a-z {graphics}argumentsa-z {lattice}a-z SaveGraphstoFiles Issue問題 Date Time Season Trend Shiny ShinyIntroduction Buildshinyapplications Learning_R LearningMapR Tools RCommandA-Z CheatSheet HowR PoweredbyGitBook Replace取代 String字元/Replace根據特徵取代 如同在修訂文件時常用的取代功能,我們常需要在文字中將符合某些特徵或關鍵字的部分搜尋出來後再取代為指定文字。

R語言中使用 sub()函數:只取代第一個搜尋到的特徵 gsub()函數:取代所有搜尋到的特徵 指定兩個參數 pattern參數:指定搜尋特徵 replacement參數:則指定要取代的文字 shaq



請為這篇文章評分?