Skip to content
  • YouTube
  • FaceBook
  • Twitter
  • Instagram

Data Analytics Ireland

Data Analytics and Video Tutorials

  • Home
  • Contact
  • About Us
    • Latest
    • Write for us
    • Learn more information about our website
  • Useful Links
  • Glossary
  • All Categories
  • Faq
  • Livestream
  • Toggle search form
  • How to check if a file is empty Python
  • TypeError: cannot unpack non-iterable int object Python
  • Tkinter GUI tutorial python – how to clean excel data Python
  • How to create a calculated field in Tableau data visualisation
  • ValueError: invalid literal for int() with base 10 Value Error
  • hide a column from a data frame Python Dataframe
  • How to use wildcards in SQL SQL
  • Regular expressions python Python

R Tutorial: How to pass data between functions

Posted on May 25, 2020March 28, 2021 By admin No Comments on R Tutorial: How to pass data between functions

When starting to look at functions and having tested them in Python and Javascript, it was quickly apparent how programming languages are so similar.

Except for the syntax you use in each; the programming is quite similar.

The purpose of this video is to:

  • Start on using functions from the ground up.
  • Don’t over-complicate the example; keep it easy enough to follow.

How to write the code to pass data between functions

As this is a short video, the code that went into making it is pretty straight forward

# create a function
function.a <- function(){
  newvarb <- 2
}

function.b <- function(){
  newvarb <- function.a()*2 # this takes in the value of function a and multiplies it by two
}
print(function.b()) # Prints out the value of function b

Below is the video that will take you through each line, and show the output that we are looking to achieve

How can we use this in our projects

No matter what programming language you use or choose to learn, the concept of functions will appear in some shape or form. Their ability to quickly run a repeatable process and return a value, which can be called from anywhere in a program allows the programmer to reduce their coding time swiftly and reduce repetitive tasks that only need to run once.

This video has an equivalent in Python, and you can see it here  Python Functions – passing data between them

Data Analytics Ireland

R Programming Tags:Data, Data Analysis, Data Analytics, Data Science, Functions, R programming language, syntax

Post navigation

Previous Post: R tutorial – How to sort lists using rstudio
Next Post: Recursion

Related Posts

  • R – How to open a file R Programming
  • R – How to check a file exists and is not empty R Programming
  • R tutorial – How to sort lists using rstudio R Programming
  • how to remove unwanted characters from your data R Programming
  • What is the r programming language R Programming

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Select your language!

  • हिंदी
  • Español
  • Português
  • Français
  • Italiano
  • How to pass multiple lists to a function and compare Python Functions
  • how to build a machine learning model machine learning
  • TypeError: cannot unpack non-iterable int object Python
  • Python Overview Interview Questions automation
  • How to import data into excel Python Tutorial
  • How To Add Values to a Python Dictionary Python
  • how to reverse a string in python strings
  • Python tutorial: How to create a graphical user interface in Tkinter Python

Copyright © 2023 Data Analytics Ireland.

Powered by PressBook Premium theme

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT