### 统计代写|数据可视化代写Data visualization代考|FIT3179

statistics-lab™ 为您的留学生涯保驾护航 在代写数据可视化Data visualization方面已经树立了自己的口碑, 保证靠谱, 高质且原创的统计Statistics代写服务。我们的专家在代写数据可视化Data visualization代写方面经验极为丰富，各种代写数据可视化Data visualization相关的作业也就用不着说。

• Statistical Inference 统计推断
• Statistical Computing 统计计算
• (Generalized) Linear Models 广义线性模型
• Statistical Machine Learning 统计机器学习
• Longitudinal Data Analysis 纵向数据分析
• Foundations of Data Science 数据科学基础

## 统计代写|数据可视化代写Data visualization代考|R Basics

For this section, we will create one $R$ script that contains a crash course in $R$, with code and comments that you will add yourself. First, let’s create a folder for all the files we will create in this book. Call it bookFiles. Inside that folder, create another folder called basics – this is where we will work in this chapter. Second, make sure you create a new script (you can use the one we created earlier if you haven’t closed it yet). In other words, your screen should look like Fig. 2.1. Third, save your empty script. Go to File $\succ$ Save (or hit Cmd $+S$ on your keyboard). Choose an intuitive name for your file, such as rBasics, and save it inside basics, the folder you just created. RStudio will save it as rBasics. R_all $R$ scripts are. R files. You will probably want to save your script every time you add a new line of code to it, just in case. Finally, all the code in question should be added to the newly created rBasics.R, so at the end of this section you will have a single file that you can go back to whenever you want to review the fundamentals.

The first thing we will do is write a comment at the top of our script (you can delete $2+5$ from your script if it’s still there). Adding comments to our scripts is important not only when we are learning $R$ but also later, when we are comfortable with the language. In a couple of months, we will likely not remember what our lines of code are doing anymore. Even though some lines are self-explanatory, our code will become more complex as we explore later chapters in this book. Having informative comments in our scripts will help us understand what our past self did-and it will also help others reproduce our analyses. Comments in $R$ must begin with a hashtag (#). Let’s add a general comment at the top of our seript (line 1), which will be a “title” for our script: # R Basics. If you try to run this line (line 1), $R$ will simply print “# R Basics” in your console (pane B). ${ }^{4}$

## 统计代写|数据可视化代写Data visualization代考|$R$ as a Calculator

We saw earlier that $R$ can be used as a powerful calculator. All the common mathematical operations are easy to remember: division (5/2), multiplication $(5 * 2)$, addition $(5+2)$, and subtraction $(5-2)$. Other math operations include exponentiation $(5 \star \star 2$ or $5 \wedge 2)$, modulus ${ }^{5}(5 \% \% 2=1)$, and integer division $(5 \% / \% 2=2$ ). Let’s add all these operations to our script and check their outputs. In Fig. 2.2, you can see our new script, rBasics.R, starting with a comment $R$ basics in line 1 . Line 2 is empty to create some white space, and line 3 creates a divider.

In line 5 , we have a short comment explaining what the following line (6) does. This is obvious here, but it can save you some time in situations where the meaning of a function is not as apparent to you. Note that the cursor is currently in line 6. You can press Cmd + Enter anywhere in a given line and RStudio will run that line (it will also move to the next line automatically for you). Alternatively, you can also run multiple lines by selecting them and then pressing Cmd + Enter. In Fig. 2.2, I have already run all lines, as you can see in the console-note that the output of a comment is the comment itself. In the console, we will see, for example, that $5 \% \% 2$ is 1 (the remainder of $5 \div 2$ ) and that $5 \% / \% 2$ is 2 (the integer that results from $5 \div 2$ ). You don’t have to reproduce the script in the figure exactly; this is just an example of how you could add some math operations and some comments to an R script.

Like with any decent calculator, you can also run more complex calculations. For example, choose any available line in rBasics. $R$ and type $4^{} \operatorname{sqrt}(9) /(2$ $* 5)$ – pi and run it (your output should be $-2.766593$ ) – as you open brackets, notice that RStudio will automatically close them for you. You can also type it in your console and hit Enter to run the code. Here we see two functions for the first time, namely, sqrt $(9)(\sqrt{9})$ and pi $(\pi)$.

## 统计代写|数据可视化代写Data visualization代考|Variables and Vectors

The values generated by the calculations we have run so far are not actually stored anywhere. If you wanted to access the value of $5 * 2$, the only way to do that would be to go back to line 9 and rerun it (or maybe scroll up and down your console window until you find the output you are looking for). This is not ideal-we need to learn about variables to be able to store and reutilize values.

Variables are objects that hold values in them. You can assign a piece of information to a variable and then access that piece of information by typing and running (i.e., “calling”) the variable. In a way, we just did that-it is easier to remember to type pi than to remember a set of digits from $\pi$. Here are two ways of assigning values to a variable: $x=5 * 2$ or $x<-5 * 2$. Let us focus on using $=$, so type $x=5^{*} 2$ in your script and run the line.When you create a variable, you will notice that nothing is actually printed in your console (except the variable assignment itself). But if you now look at pane $\mathrm{C}$ (Environment), you will notice $\mathrm{x}$ is there, holding the value 10 (i.e., the result of $5 * 2$ ). From now on, you can simply type $x$ and run it, and $R$ will print the value it holds $(10)$. If you now type $x=x+10$ in the next line of your script, you are telling $R$ to “update” the value of $x$ and which will now be $20(x=10+10)$. If you want to go back to what $x$ was before, you can rerun the line where you specify $x=5^{*} 2$ and woilà. By having different lines of code, you can go back to any stage of your analysis at any time. If you are used to Cmd $+Z$ in other applications, having a script gives you all the redos you will ever need, with the advantage that you can choose which part of your analysis you wish to jump to by rerunning specific lines of code-the History tab in pane $\mathrm{C}$ will list all the lines of code we have already run. ${ }^{6}$ This is illustrated in lines 1 and 2 in code block $1^{7}$

## 有限元方法代写

tatistics-lab作为专业的留学生服务机构，多年来已为美国、英国、加拿大、澳洲等留学热门地的学生提供专业的学术服务，包括但不限于Essay代写，Assignment代写，Dissertation代写，Report代写，小组作业代写，Proposal代写，Paper代写，Presentation代写，计算机作业代写，论文修改和润色，网课代做，exam代考等等。写作范围涵盖高中，本科，研究生等海外留学全阶段，辐射金融，经济学，会计学，审计学，管理学等全球99%专业科目。写作团队既有专业英语母语作者，也有海外名校硕博留学生，每位写作老师都拥有过硬的语言能力，专业的学科背景和学术写作经验。我们承诺100%原创，100%专业，100%准时，100%满意。

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。