- Web Application Development with R Using Shiny(Third Edition)
- Chris Beeley Shitalkumar R. Sukhdeve
- 110字
- 2021-07-16 17:52:07
Functions
As you grow in confidence with R, you will want to begin writing your own functions. This is achieved very simply, and in a manner quite similar to many other languages. You will no doubt want to read more about writing functions in R in more detail, but just to give you an idea, the following code is a function called the sumMultiply function that adds together x and y and multiplies the result by z:
sumMultiply <- function(x, y, z){ final = (x+y) * z return(final) }
This function can now be called using sumMultiply(2, 3, 6), which will return 2 plus 3 times 6, which gives 30.
推薦閱讀
- 微商之道
- FreeSWITCH 1.2
- 連接未來:從古登堡到谷歌的網(wǎng)絡(luò)革命
- Twilio Cookbook
- Force.com Development Blueprints
- Web Application Development with R Using Shiny
- 互聯(lián)網(wǎng)安全的40個智慧洞見:2015年中國互聯(lián)網(wǎng)安全大會文集
- 雷達(dá)饋線技術(shù)
- 網(wǎng)管員必讀:網(wǎng)絡(luò)管理(第2版)
- 高級網(wǎng)絡(luò)技術(shù)
- 從實踐中學(xué)習(xí)手機抓包與數(shù)據(jù)分析
- INSTANT LinkedIn Customization How-to
- Implementing NetScaler VPX?
- 物聯(lián)網(wǎng)的機遇與利用
- Laravel Application Development Cookbook