This article introduces some basic R concepts that may help when using the UKFE package as well as links to other R resources.
In R, we can perform arithmetic operations, for example, try typing the following in the console:
An object acts as a container for storing data. For example, you can
assign some text (called a string) to the object called
greeting
:
You can then use this variable later:
Numbers can be stored in numeric variables:
These can then be used in arithmetic operations:
Vectors are one-dimensional arrays that store data. Each element has
the same data type. To create one, you can use the c
function, which stands for combine
or
concatenate
. UKFE uses lots of numeric vectors.
You can perform calculations with vectors:
Data frames are structures made up of rows and columns, similar to the structure of a csv file. Each column in a data frame is a vector.
R contains some built-in functions. For example, we can use the
mean()
function to find the mean of a vector:
We can also use a variable inside a function:
You can learn about the functions in the UKFE package using this documentation and the functions’ help files.
If you are finding the UKFE documentation difficult to follow, or if you would like to further develop your knowledge of R, there are many resources available to help. The following suggestions are particularly useful for those who are new to R or programming in general.
If you have questions specifically about this package, you may find it helpful to visit the GitHub Discussions forum associated with the repository. This is a good place to ask questions, report issues, or see if others have encountered similar problems.
Stack Overflow is a useful resource for general R-related queries, especially for language syntax, errors, and troubleshooting.