Conditional statements and repeated operations are some of the important aspects in any programming, whether it is in the data science area or for general programming purpose. Often, you will need to test several alternative statements. For example, if you are optimizing any mathematical function, the stopping rule depends on the conditional statement. Also, if you are solving any equation that needs iteration, you must use the repetition operator. The recipes of this chapter will give you a basic understanding of the use of conditional and repetitive statements in R. Each recipe contains certain context and code with explanation. You will feel confident in writing a conditional statement and using a loop in R after reading this chapter.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia