官术网_书友最值得收藏!

  • R Programming Fundamentals
  • Kaelen Medeiros
  • 132字
  • 2021-07-23 16:58:18

Using R and RStudio

Out of the box, R is completely usable. Open R on your machine. Let's use R for some basic arithmetic such as addition, multiplication, subtraction, and division. The following screenshot demonstrates this:

It also provides functions such as sum() and sqrt() for addition and calculation of the square root. The following screenshot shows this in action:

R can—and will—do basic arithmetic like a calculator, using symbols you're familiar with. One you may not have used before is exponentiate, where you use two asterisks, for example, 4 ** 2, which you can read as 4 to the power of 2.

Once you want to start doing math beyond basic arithmetic, such as finding square roots or summing many numbers, you have to start using functions.

主站蜘蛛池模板: 常山县| 北海市| 大同市| 察隅县| 锡林浩特市| 台南县| 盘山县| 洛阳市| 禹州市| 镇雄县| 班戈县| 通道| 定南县| 保康县| 南漳县| 娄底市| 五峰| 荣成市| 且末县| 漳浦县| 来凤县| 岫岩| 峨眉山市| 保康县| 乌恰县| 商都县| 苏尼特左旗| 内乡县| 延长县| 集安市| 南城县| 通江县| 玛纳斯县| 五莲县| 宝兴县| 庐江县| 济源市| 惠州市| 论坛| 句容市| 南阳市|