Skip to content

Commit

Permalink
R tip: Load script
Browse files Browse the repository at this point in the history
  • Loading branch information
renegarcia committed Aug 19, 2023
1 parent ef3b87b commit 3c8d0da
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions notes/code.r.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
id: 1fm4dncuybvd5vqj931b01n
title: Coding tips for the R programming language
desc: ''
updated: 1692464690591
created: 1692464253688
---

# Load R script into session

To load the contents of an R script, you can use the `source()` function¹. This function reads the specified R script file and runs the code contained within it. For example, if you have an R script named `my_script.R` in your working directory, you can load its contents by running the following command in the R console: `source("my_script.R")`¹. This will execute all of the code contained within the `my_script.R` file¹.


**Source:** [Conversation with Bing](https://sl.bing.net/f9X2XdJtdJc), 19/8/2023

## References

* (1) Run R script from command line - Stack Overflow. https://stackoverflow.com/questions/18306362/run-r-script-from-command-line.
* (2) load function - RDocumentation. https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/load.

0 comments on commit 3c8d0da

Please sign in to comment.