# Loop Functions

## Loop Functions in R

Loop functions are some of the most powerful functions in R. They are very easy to use, especially in an interactive setting, and make it possible do to a lot of work while writing less code.&#x20;

To start learning about loop functions, watch the following videos from Coursera, and return here afterward:

1. [Loop functions - lapply](https://www.coursera.org/learn/r-programming/lecture/t5iuo/loop-functions-lapply)
2. [Loop functions - apply](https://www.coursera.org/learn/r-programming/lecture/IUUhK/loop-functions-apply)
3. [Loop functions - mapply](https://www.coursera.org/learn/r-programming/lecture/EBnAr/loop-functions-mapply)
4. [Loop functions - tapply](https://www.coursera.org/learn/r-programming/lecture/w98BR/loop-functions-tapply)

These are the last videos from Coursera in this guide. However, you are encouraged to continue the course and finish it if you so choose.

## swirl Exercises

To practice everything you just learned about loop functions, complete the following swirl lessons:

1. swirl Lesson 10: lapply and sapply
2. swirl Lesson 11: vapply and tapply

## Congratulations!

If you made it here, then congratulations! You have successfully completed this section. Move to the next portion of the guide with the arrow buttons below.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abi.am/abi-omicss-guide-2021/week-3/r-programming/loop-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
