>
> Hi,
>
> The program I am writing requires me to append named objects to my
> existing list objects dynamically.
>
> So my list object is retval. retval always has a metadatatabletype object
>
> createMetadata=TRUE
> retval <-list()
> retval$metadatatype =c("normal")
> retval$metadata=NULL
>
> How, depending on certain logic, I create a metadata object
>
> if (createMetadata==TRUE) retval$metadata =rbind(retval$metadata,c(1,0) )
> The results are
> > retval$metadata
>      [,1]     [,2]
> [1,] "normal" "normal"
> [2,] "1"      "0"
>
>
> What I expected to see is
> > retval$metadata
>      [,1]     [,2]
> [1,] "1"      "0"
>
>
>
> I have been able to reproduce this problem only when the object
> retval$metadata is NULL and there is an existing object that has a valid
> value and the NULL object is a sub-string (prefix) of the existing object
> with a valid value.
>
> Also, retval$metadata takes on a value of "normal" even though it has been
> explicity set as NULL
>
> Your assistance is appreciated.
>
> Thanks
> Vathaid
>
>
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to