Due of my inexperience with programming and newness to R, my query and shoddy code are both newbie mistakes.

I was given a task in which I had to construct Fibonacci sequence numbers that were less than 4,000,000 using a while loop (the Fibonacci sequence is characterised by the fact that every number after the first two is the sum of the two preceding ones).

The total of the even integers in the created sequence had to then be calculated.

My response was successful, however I don't think the code was written very effectively. What might I have done differently?

If (x == 0 & y == 1), then > x - 0 > y - 1 > z - 0 While (x 4000000), cat(x), cat(y), cat(" ")r
Jul 5, 2022 267 views

## Introduction to Statistical Learning with Applications in R Figure Codes

I recently bought the following book: An Introduction ...READ MORE

## Difference between the == and %in% operators in R

percent in percent "returns a vector of ...READ MORE

## Difference between the == and %in% operators in R

According to help('percent in percent'), percent in ...READ MORE

## How to make loop for one-at-a time logistic regression in R?

You're probably looking for something similar to ...READ MORE

## do-while loop in R

Unlike for and while loops, which test the loop condition at ...READ MORE

## What does c do in R?

The c function in R programming usually stands ...READ MORE

## Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE