How can I fix this error without using for loop

this is my code

```
carr_samp <- read_csv("C:/Users/acer/OneDrive/Desktop/New folder (14)/samm.csv")
a <- c(2.938026, 3.456584)
a1=a[1]/4
a2=a[2]/4
b <- c(1/0.8273983, 1/0.4934418)
b1=b[1]^(1/4)
b2=b[2]^(1/4)
if (DF$Number_of_Claims==1)
{
a1=a1
a2=a2
b1=b1
b2=b2
}
if (DF$Number_of_Claims==2)
{
a1=a1+a1
a2=a2+a2
b1=b1+b1
b2=b2+b2
}
if (DF$Number_of_Claims==3)
{
a1=a1+a1+a1
a2=a2+a2+a2
b1=b1+b1+b1
b2=b2+b2+b2
}
if (DF$Number_of_Claims==4)
{
a1=a1+a1+a1+a1
a2=a2+a2+a2+a2
b1=b1+b1+b1+b1
b2=b2+b2+b2+b2
}
```

I got these messages:

Warning message:

In if (DF$Number_of_Claims == 1) { :

the condition has length > 1 and only the first element will be used

Warning message:

In if (DF$Number_of_Claims == 2) { :

the condition has length > 1 and only the first element will be used

Warning message:

In if (DF$Number_of_Claims == 3) { :

the condition has length > 1 and only the first element will be used

Warning message:

In if (DF$Number_of_Claims == 4) { :

the condition has length > 1 and only the first element will be used