Question: Circular-Linear Regression In R: Error in while (diff > tol) { : missing value where TRUE/FALSE needed
0
5.5 years ago by
fx20380
fx20380 wrote:

Hi all,

I have read through the google results, there were some similar error but different situations. I wonder if there anyone can figure out how to solve mine.

I tried to analyse some circular and linear data, thus use the package 'Circular'. My model is just a very simple one:

`lm.circular(orientation,colour,init=c(12),type='c-l')`

As you can see there is only 12 data in both variables, it is very obvious if there is NA or not. There is not (most of the replies online said the error means that there is NA)!

##got errors

`Error in while (diff > tol) { : missing value where TRUE/FALSE needed`

I wonder what (diff>tol) means here. How could I solve this problem?

My workflow is as following:

```library('circular')

#Converse circular data, make sure variable is recognized as circular data in r

orientation<-circular(orientation,type=c("angles"),units="degrees",zero=0)

>orientation

Circular Data:
Type = angles
Units = degrees
Template = none
Modulo = asis
Zero = 0
Rotation = counter
[1] 15.46 25.59 76.92 83.29 67.26 86.71 66.28 83.50 72.03 77.19 60.36 74.54

>colour

[1] 0.1224 0.1312 0.1606 0.1635 0.1375 0.0997 0.0739 0.2885 0.1080 0.0547 0.1134
[12] 0.1516```

Many thanks!

Feng

R • 2.2k views