# Analysis on R

#### BeaLena

##### New Member
Hi there,
I began using R last week and... It drives me crazy!
However, I'm using the package "AnalyzefMRI" and that's right, but I have some problems related to atomic vector.
Here's my code:

>library(AnalyzeFMRI)

Error in hdr$dim :$ operator is invalid for atomic vectors

It's ok, until the last command.
Any help? What's the problem on the header file?
I understood the story about atomic, recursive, matrix and vectors, but I can't see how it's linked to my case... Thanks!:wave:

#### sirps

##### New Member
Hi,

Did you find a solution? I'm having the same problem and receiving the same error message. I too have read the story about atomic, recursive, matrix, and vectors and cannot see how it relates to the problem. Thanks!

#### sirps

##### New Member
Hi!

Just to let you know, my problem was in the earlier code.

for (t in 1: length(files)) {file = files[t]; img = f.read.analyze.volume(file)[, , slice, 1]; data[, , t] <- img}

My variable slice was out of bounds and for some reason this gave me the error:
Error in hdr$dim :$ operator is invalid for atomic vectors

When I reduced the value of slice, the commands ran smoothly.

#### BeaLena

##### New Member
Hi everybody!
Yes, I solved the problem. In my case it was a problem of format: my images were DICOM, but f.read.analyze.volume can read only Analyze format :yup: