[R] type of object of a variable in a data frame

David Winsemius dwinsemius at comcast.net
Thu Mar 13 14:33:01 CET 2008


Chang Liu <changisme at hotmail.com> wrote in
news:BAY144-W56113AA5B8B59D44C17F37BE080 at phx.gbl: 

> 3. The reason I want it to be a list or vector, is that I want to
> fill in some blank values, i can't seem to do things like: 
> data$V1[1] = 3 Is it because these variables are pointers? Is there
> a better way to do this? 
> 

You have not given reproducible code, so it is difficult to know why that 
does not succeed. I have a data.frame with a similar name left over from 
another problem. When I enter DATA$V1[1] = -.5 , it has the desired 
effect. Although it is not the source of the error,  you should learn to 
use "<-" rather than "=". You should also learn to post questions with 
reproducible code.

-- 
David Winsemius



More information about the R-help mailing list