跳到主要內容

R 語言翻轉教室-1

基礎指令:

skip(), submit() 兩者皆屬swirl 指令
play()可以終止swirl,自行摸索R語言
nxt()可以返回課程
bye()即可離開課程
swirl即可返回關卡

my_progress()可以查詢目前登入的使用者完成的單元。




Lesson 1 :Introduction

<此部分直接進入實作階段>

如果對於函數說明有疑問,即輸入`help(__函數__)`or `?solve`

通常給R的指令分為兩種,一個expression, 一個是assignment

ex: a <- 1即是一個assignment
ex2: 如果R收到一個expression,則會去評估這個expression,然後把結果顯示在螢幕上。

a+1

此時會收到結果為2
(因為我們前面已經assign “a” 為1)

進階:利用{}包覆expression,可以變成一個大的expression

若要在R中加入註解使用#即可讓之後輸入的內容被R略過

如果有一個expression還沒有完成,(可能是少了`)`或`}`),那R會在console的開頭用`+`進行提示。

R中存放資料的東西叫做object,如上面範例中的“a”,object 可以是一個變數、一連串的數字、文字、函數...等等。
可以利用objects(), ls()來列出目前存在的object名稱。

若要移除當前的物件,請使用rm()

本課程學習筆記,參考:R 語言翻轉教室

留言

這個網誌中的熱門文章

【Android Development for Beginners】 Lesson 2A : Create a New Project , Plan How to Build the Layout, Build Layout

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2A : Create a New Project Plan How to Build the Layout Build layout Follow the instruction below to build up a new app called "Just Java" use empty activity .

【 Android Development for Beginners】 Lesson 3A : Object Oriented Programming - 4

(I think Lesson 3A is the most important but also the most difficult part for beginner so far ) This Notes is according to the udacity free course : Android Development for Beginners Lesson 3A : Object Oriented Programming Call Method on an objects If We want to call a method on an object object variable name . method name ( input argument ); ex: titleTextView.setText("News"); You need to make sure you put a right object so you can call the method

【Android Development for Beginners】Lesson 2B : String Data Type, Combining Strings Together, and Integer Variables

This Notes is according to the udacity free course : Android Development for Beginners Lesson 2B :  String Data Type,  Combining Strings Together and Integer Variables Finally We cross the river and change the layouts successfully. But We can do it better by letting the price change automatically but not change after the we click the "order" button. So this is what we want to do in this class.