Youtube

While  loops are used when we don’t know the exact number of times a block of code is to be repeated.  
The primary difference between a `for` loop and a `while` loop is: a `for` loop is used when the number of iterations a code should be run is known where a `while` loop is used when the number of iterations is not known. 

The while loop has the test_expression. It first gets evaluated.  If the result is TRUE, then the block of code inside the while  loop gets executed.  Once the execution is completed, the test_expression  is evaluated again and the same process is repeated until the test_expression  evaluates to FALSE. 

However, while loops may end up into infinite loops.  Therefor, we must remain very cautious in using while loops and check diligently if the loop is not getting repeated into infinite number of times.

About Author
-------------------------------------------------------------------------------------------------------------------------------------------------
My name is Siddharth Sahasrabudhe. I am a founder of Plotly Analytics. I help business professionals learn data science using R programming. All my learning resources are easy to follow, thorough and anyone can follow them regardless of one's professional and educational background.

Find out more about plotly analytics here:
https://plotlyanalytics.com/

Connect with me on LinkedIn:
https://www.linkedin.com/in/siddharth-sahasrabudhe-b60a9711/

Connect with me on Twitter:
https://x.com/PlotlyAnalytics

For one-on -one or group trainings in R language, please contact me at:
siddharth.sahasrabudhe@plotlyanalytics.com

While loops are used when we don’t know the exact number of times a block of code is to be repeated.
The primary difference between a `for` loop and a `while` loop is: a `for` loop is used when the number of iterations a code should be run is known where a `while` loop is used when the number of iterations is not known.

The while loop has the test_expression. It first gets evaluated. If the result is TRUE, then the block of code inside the while loop gets executed. Once the execution is completed, the test_expression is evaluated again and the same process is repeated until the test_expression evaluates to FALSE.

However, while loops may end up into infinite loops. Therefor, we must remain very cautious in using while loops and check diligently if the loop is not getting repeated into infinite number of times.

About Author
-------------------------------------------------------------------------------------------------------------------------------------------------
My name is Siddharth Sahasrabudhe. I am a founder of Plotly Analytics. I help business professionals learn data science using R programming. All my learning resources are easy to follow, thorough and anyone can follow them regardless of one's professional and educational background.

Find out more about plotly analytics here:
https://plotlyanalytics.com/

Connect with me on LinkedIn:
https://www.linkedin.com/in/siddharth-sahasrabudhe-b60a9711/

Connect with me on Twitter:
https://x.com/PlotlyAnalytics

For one-on -one or group trainings in R language, please contact me at:
siddharth.sahasrabudhe@plotlyanalytics.com

0 0

YouTube Video VVVySUEtczhMS1F4YW5Ra0dOMWtkNlRBLlpfeXN0cjBqMmc0

How to write WHILE loop in R?

Plotly Analytics - Giving Life to Data 7 hours ago

How to write IF statement in R?

Plotly Analytics - Giving Life to Data July 15, 2024 11:44 am

How to import .CSV file in R using RStudio interface?

Plotly Analytics - Giving Life to Data July 12, 2024 10:31 am

Sub-setting a data frame is similar to sub-setting a Matrix. There are several different options one can use while sub-setting a data frame. in this video we will look at 7 options that are most widely used in sub-setting the data frame. In this video we ill learn:
 - How to subset data frame using row and column index positions
- How to subset data frame using row index positions
- How to subset data frame using column index positions
- How to subset data frame using logical vector
- How to subset data frame using numeric vector
- How to subset data frame using conditional operator
- How to subset data frame using column names

Some handy functions to explore the data frame such as summary( ) function and dim( ) function are also used in this video.

Link to the video - How to access elements in Matrix
https://youtu.be/PzCS9LG4ROk

About Author
-------------------------------------------------------------------------------------------------------------------------------------------------
My name is Siddharth Sahasrabudhe. I am a founder of Plotly Analytics. I help business professionals learn data science using R programming. All my learning resources are easy to follow, thorough and anyone can follow them regardless of one's professional and educational background.

Find out more about plotly analytics here:
https://plotlyanalytics.com/

Connect with me on LinkedIn:
https://www.linkedin.com/in/siddharth-sahasrabudhe-b60a9711/

Connect with me on Twitter:
https://x.com/PlotlyAnalytics

For one-on -one or group trainings in R language, please contact me at:
siddharth.sahasrabudhe@plotlyanalytics.com

Sub-setting a data frame is similar to sub-setting a Matrix. There are several different options one can use while sub-setting a data frame. in this video we will look at 7 options that are most widely used in sub-setting the data frame. In this video we ill learn:
- How to subset data frame using row and column index positions
- How to subset data frame using row index positions
- How to subset data frame using column index positions
- How to subset data frame using logical vector
- How to subset data frame using numeric vector
- How to subset data frame using conditional operator
- How to subset data frame using column names

Some handy functions to explore the data frame such as summary( ) function and dim( ) function are also used in this video.

Link to the video - How to access elements in Matrix
https://youtu.be/PzCS9LG4ROk

About Author
-------------------------------------------------------------------------------------------------------------------------------------------------
My name is Siddharth Sahasrabudhe. I am a founder of Plotly Analytics. I help business professionals learn data science using R programming. All my learning resources are easy to follow, thorough and anyone can follow them regardless of one's professional and educational background.

Find out more about plotly analytics here:
https://plotlyanalytics.com/

Connect with me on LinkedIn:
https://www.linkedin.com/in/siddharth-sahasrabudhe-b60a9711/

Connect with me on Twitter:
https://x.com/PlotlyAnalytics

For one-on -one or group trainings in R language, please contact me at:
siddharth.sahasrabudhe@plotlyanalytics.com

0 0

YouTube Video VVVySUEtczhMS1F4YW5Ra0dOMWtkNlRBLkJjUnZfNFE0bEVF

How to access elements from a Data Frame in R?

Plotly Analytics - Giving Life to Data July 10, 2024 12:41 pm

A gentle introduction to Data Frames in R

Plotly Analytics - Giving Life to Data July 9, 2024 12:31 pm

Scroll to Top