Introduction to Writing Functions in R
Take your R skills up a notch by learning to write efficient, reusable functions.
Comienza El Curso Gratis4 horas14 vídeos52 ejercicios45.089 aprendicesDeclaración de cumplimiento
Crea Tu Cuenta Gratuita
o
Al continuar, acepta nuestros Términos de uso, nuestra Política de privacidad y que sus datos se almacenan en los EE. UU.¿Entrenar a 2 o más personas?
Probar DataCamp for BusinessPreferido por estudiantes en miles de empresas
Descripción del curso
Being able to write your own functions makes your analyses more readable, with fewer errors, and more reusable from project to project. Function writing will increase your productivity more than any other skill! In this course you'll learn the basics of function writing, focusing on the arguments going into the function and the return values. You'll be writing useful data science functions, and using real-world data on Wyoming tourism, stock price/earnings ratios, and grain yields.
¿Entrenar a 2 o más personas?
Obtén a tu equipo acceso a la plataforma DataCamp completa, incluidas todas las funciones.En las siguientes pistas
Desarrollador R
Ir a la pistaProgramación R
Ir a la pista- 1
How to Write a Function
GratuitoLearn why writing your own functions is useful, how to convert a script into a function, and what order you should include the arguments.
Why you should use functions50 xpCalling functions100 xpThe benefits of writing functions50 xpConverting scripts into functions50 xpConverting a script to a function100 xpYour first function: tossing a coin100 xpInputs to functions100 xpMultiple inputs to functions100 xpY kant I reed ur code?50 xpData or detail?100 xpRenaming GLM100 xp - 2
All About Arguments
Learn how to set defaults for arguments, how to pass arguments between functions, and how to check that users specified arguments correctly.
Default arguments50 xpNumeric defaults100 xpLogical defaults100 xpNULL defaults100 xpCategorical defaults100 xpPassing arguments between functions50 xpHarmonic mean100 xpDealing with missing values100 xpPassing arguments with ...100 xpChecking arguments50 xpThrowing errors with bad arguments100 xpCustom error logic100 xpFixing function arguments100 xp - 3
Return Values and Scope
Learn how to return early from a function, how to return multiple values, and understand how R decides which variables exist.
Returning values from functions50 xpReturning early100 xpReturning invisibly100 xpReturning multiple values from functions50 xpReturning many things100 xpReturning metadata100 xpEnvironments50 xpCreating and exploring environments100 xpDo variables exist?100 xpScope and precedence50 xpCan a function find its variables?100 xpCan you access variables from inside functions?100 xpVariable precedence 150 xpVariable precedence 250 xp - 4
Case Study on Grain Yields
Apply your function writing skills to a case study involving data preparation, visualization, and modeling.
Grain yields and unit conversion50 xpConverting areas to metric 1100 xpConverting areas to metric 2100 xpConverting yields to metric100 xpApplying the unit conversion100 xpVisualizing grain yields50 xpPlotting yields over time100 xpA nation divided100 xpPlotting yields over time by region100 xpModeling grain yields50 xpRunning a model100 xpMaking yield predictions100 xpDo it all over again100 xpCongratulations50 xp
¿Entrenar a 2 o más personas?
Obtén a tu equipo acceso a la plataforma DataCamp completa, incluidas todas las funciones.En las siguientes pistas
Desarrollador R
Ir a la pistaProgramación R
Ir a la pistaconjuntos de datos
Snake River visitsStandard & Poor 500 price/earnings ratiosNASS corn yieldsNASS wheat yieldsNASS barley yieldscolaboradores
Richie Cotton
Ver MásData Evangelist at DataCamp
¿Qué tienen que decir otros alumnos?
¡Únete a 15 millones de estudiantes y empieza Introduction to Writing Functions in R hoy mismo!
Crea Tu Cuenta Gratuita
o
Al continuar, acepta nuestros Términos de uso, nuestra Política de privacidad y que sus datos se almacenan en los EE. UU.