The R help function
In R information about individual functions can be found on the function manual page including:
- description: what the function does
- usage: shows the syntax of the function including all arguments - this is a generalised form of how you would use the function
- arguments: of the function. These are all the things you can customise in the function
- details and values: give some additional information about the function
- examples: of how the function is run. You will be able to copy and paste these examples into R/RStudio to run yourself
You can access the help page of a function in a number of ways
- To open up the help page within R/RStudio using the help command :
help(insert_function_name) # an example for print() help(print)
- an equivalent command is to use the help operator
?
:
?(print)
- both commands will open up the print function in a web page in windows (or the manual page inside the terminal in Linux)
- In your script, type and run
Print()
print("Hello world") #output below > print("hello world") [1] "hello world"
Information: Print()
According to the manual, the print command has the usage
print(x..)
Function_name(arg1)
where x is “Hello world”
Next section
DataSHIELD Wiki by DataSHIELD is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.datashield.ac.uk/wiki