Introduction to Writing Functions in R
Take your R skills up a notch by learning to write efficient, reusable functions.
Comece O Curso Gratuitamente4 horas14 vídeos52 exercícios45.076 aprendizesDeclaração de Realização
Crie sua conta gratuita
ou
Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados são armazenados nos EUA.Treinar 2 ou mais pessoas?
Tentar DataCamp for BusinessAmado por alunos de milhares de empresas
Descrição do 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.
Treinar 2 ou mais pessoas?
Obtenha acesso à sua equipe à plataforma DataCamp completa, incluindo todos os recursos.Nas seguintes faixas
Desenvolvedor R
Ir para a trilhaProgramação R
Ir para a trilha- 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
Treinar 2 ou mais pessoas?
Obtenha acesso à sua equipe à plataforma DataCamp completa, incluindo todos os recursos.Nas seguintes faixas
Desenvolvedor R
Ir para a trilhaProgramação R
Ir para a trilhaconjuntos de dados
Snake River visitsStandard & Poor 500 price/earnings ratiosNASS corn yieldsNASS wheat yieldsNASS barley yieldscolaboradores
Richie Cotton
Ver MaisData Evangelist at DataCamp
O que os outros alunos têm a dizer?
Junte-se a mais de 15 milhões de alunos e comece Introduction to Writing Functions in R hoje mesmo!
Crie sua conta gratuita
ou
Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados são armazenados nos EUA.