在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → R CookBook

R CookBook

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:9.45M
  • 下载次数:10
  • 浏览次数:114
  • 发布时间:2020-08-11
  • 实例类别:一般编程问题
  • 发 布 人:robot666
  • 文件格式:.pdf
  • 所需积分:2
 

实例介绍

【实例简介】
R CookBook 全书以问题为基础 提供了很多关于R语言应用的小例子和建议
R Cookbook R Cookbook Paul teetor O REILLY Beijing· Cambridge· Farnham·Koln· Sebastopol· Tokyo R Cookbook by Paul Teetor Copyright o 2011 Paul Teetor. All rights reserved Printed in the United States of america Published by O Reilly Media, Inc, 1005 Gravenstein Highway North, Sebastopol, CA 95472 O'Reilly books may be purchased for educational, business, or sales promotional use. Online editions arealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformationcontactour corporate/institutionalsalesdepartment:(800)998-9938orcorporate@oreilly.com Editor: Mike Loukides Indexer: jay marchand Production editor: Adam zaremba Cover designer Karen montgomery Copyeditor: Matt Darnell Interior Designer: David Futato Proofreader: Jennifer Knight llustrator: robert ro Printing histo March 2011 t edition Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc. R Cookbook, the image of a harpy eagle, and related trade dress are trademarks of O'Reilly Media, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as rademarks. Where those designations appear in this book, and O Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information con tained herein ISBN:978-0-596-80915-7 1299102737 Table of contents Preface 1. Getting Started and Getting Help 1.1 Downloading and Installing R 1.2 Starting r 4 1.3 Entering Commands 1.4 Exiting from R 1.5 Interrupting R 1.6 Viewing the Supplied Documentation 10 1.7 Getting Help on a Function 1. 8 Searching the Supplied Documentation 1. 9 Getting Help on a Package 14 1.10 Searching the Web for help 16 1. 11 Finding Relevant Functions and Packages 18 1.12 Searching the Mailing Lists 1.13 Submitting questions to the mailing lists 20 2. Some basics 2. 1 Printing Something 2.2 Setting variables 2. 3 Listing variables 26 2.4 Deleting Variables 2.5 Creating a Vector 2.6 Computing Basic Statistics 30 2.7 Creating Sequences 32 2.8 Comparing vectors 34 2.9 Selecting Vector Elements 35 2.10 Performing Vector Arithmetic 38 2. 11 Getting operator Precedence right 40 2.12 Defining a Function 41 2.13 Typing Less and Accomplishing More 43 2. 14 Avoiding Some Common Mistakes 46 3. Navigating the Software......................... 51 3. 1 Getting and Setting the Working Directory 3.2 Saving your workspace 52 3.3 Viewing Your Command History 3.4 Saving the result of the Previous command 53 3.5 Displaying the Search Path 54 3.6 Accessing the Functions in a Package 3.7 Accessing Built-in Datasets 7 3.8 Viewing the list of Installed Packages 58 3.9 Installing Packages from CRAN 9 3.10 Setting a Default CRAN Mirror 61 3.11 Suppressing the Startup Message 62 3.12 Running a Script 62 3. 13 Running a Batch Script 3. 14 Getting and Setting Environment variables 66 3.15 Locating the r home directory 67 3.16 Customizing r 68 4. Input and output… 4.1 Entering Data from the Keyboard 72 4.2 Printing Fewer Digits (or More Digits) 4.3 Redirecting Output to a file 7 4.4 Listing Files 4.5 Dealing with“ Cannot Open File” in windows 76 4.6 Reading Fixed-Width Records 4.7 Reading Tabular Data Files 4.8 Reading from CSV Files 4.9 Writing to Csv files 82 4.10 Reading tabular or CSV Data from the Web 4.11 Reading Data from HTML Tables 4.12 Reading Files with a Complex Structure 4.13 Reading from MySQL Databases 89 4.14 Saving and Transporting Objects 92 5. Data structures 95 5. 1 Appending data to a vector 101 5.2 Inserting Data into a Vector 103 5.3 Understanding the Recycling rule 103 5.4 Creating a Factor( Categorical Variable) 105 5.5 Combining Multiple Vectors into One Vector and a Factor 107 5.6 Creating a list 108 I Table of Contents 5.7 Selecting List Elements by Position 109 5.8 Selecting List Elements by Name 5.9 Building a Name/Value Association List 112 5.10 Removing an Element from a List 114 5.11 Flatten a List into a Vector 115 5.12 Removing null elements from a List 5.13 Removing List Elements Using a Condition 5. 14 Initializing a matrix 118 5.15 Performing Matrix Operations 119 5.16 Giving Descriptive Names to the Rows and Columns of a Matrix 120 5.17 Selecting One Row or Column from a matrix 121 5.18 Initializing a Data Frame from Column Data 12 5.19 Initializing a Data Frame from Row Data 123 5.20 Appending Rows to a Data Frame 125 5.21 Preallocating a Data Frame 126 5.22 Selecting Data Frame Columns by Position 127 5.23 Selecting Data Frame Columns by name 131 5.24 Selecting rows and Columns More easily 132 5.25 Changing the Names of Data Frame Columns 133 5.26 Editing a Data Frame 135 5.27 Removing NAs from a Data Frame 136 5.28 Excluding Columns by name 137 5.29 Combining Two Data Frames 138 5.30 Merging Data Frames by Common Column 140 5.31 Accessing Data Frame Contents More Easily 141 5.32 Converting One Atomic Value into Another 143 5.33 Converting One Structured Data Type into Another 144 6. Data transformations 147 6. 1 Splitting a Vector into Groups 148 6.2 Applying a Function to Each List Element 149 6.3 Applying a Function to Every row 151 6.4 Applying a function to Every Column 152 6.5 Applying a Function to groups of data 154 6.6 applying a Function to groups of rows 156 6.7 Applying a Function to Parallel Vectors or Lists 158 7. Strings and dates 61 7.1 Getting the Length of a String 163 7.2 Concatenating Strings 163 7.3 Extracting Substrings 164 7.4 Splitting a String according to a delimiter 165 7.5 Replacing Substrings 166 Table of contents|ⅶi 7.6 Seeing the Special characters in a String 167 7.7 Generating All Pairwise Combinations of Strings 7. 8 Getting the Current Date 169 7.9 Converting a string into a date 170 7.10 Converting a Date into a String 171 7.11 Converting Year, Month, and Day into a Date 172 7. 12 Getting the Julian Date 173 7. 13 Extracting the Parts of a Date 174 7. 14 Creating a Sequence of dates 175 8. Probability......... 177 8.1 Counting the Number of Combinations 179 8.2 Generating Combinati 180 8. 3 Generating Random Numbers 180 8.4 Generating Reproducible Random Numbers 182 8.5 Generating a Random Sample 8.6 Generating Random Sequences 184 8.7 Randomly Permuting a Vector 185 8.8 Calculating Probabilities for Discrete Distributions 186 8.9 Calculating Probabilities for Continuous Distributions 188 8.10 Converting Probabilities to Quantiles 189 8.11 Plotting a Density Function 190 9. General statistics 195 9.1 Summarizing your data 197 9.2 Calculating relative frequencies 9.3 Tabulating Factors and Creating Contingency Tables 200 9.4 Testing Categorical Variables for Independence 201 9.5 Calculating Quantiles(and Quartiles)of a Dataset 201 9.6I ng a Quantile 202 9. 7 Converting data to z-scores 203 9.8 Testing the Mean of a Sample(t Test) 203 9.9 Forming a Confidence Interval for a Mean 205 9.10 Forming a Confidence Interval for a Median 206 9. 11 Testing a Sample proportion 207 9 12 Forming a Confidence Interval for a Proportion 208 9.13 Testing for normality 209 9. 14 Testing for Runs 210 9.15 Comparing the Means of Two Samples 212 9.16 Comparing the locations of two samples nonparametrically 213 9. 17 Testing a Correlation for Significanc 215 9. 18 Testing Groups for Equal Proportions 216 9 19 Performing Pairwise Comparisons Between Group Means 218 ⅶ ii Table of Contents 【实例截图】
【核心代码】

标签:

实例下载地址

R CookBook

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警