Skip to content
Back to formatted view

Raw Message

Message-ID: <3F67EF0A-DB2F-469A-9B80-774EEDCA9ACE@comcast.net>
Date: 2010-12-26T13:24:04Z
From: David Winsemius
Subject: R2WinBugs data import error
In-Reply-To: <1293342290740-3164106.post@n4.nabble.com>

On Dec 26, 2010, at 12:44 AM, unsown wrote:

>
> For some purpose, I  need to transfer a NAs array to WinBugs through
> R2WinBugs, But I constantly got an error message:"'type' must be  
> "real" for
> this format". Here is my data to transfer:
>
> x = matrix(data=NA,nrow=3,ncol=3)

str(x)
It is of mode "logical".

Try instead:
x = matrix(vector(mode="numeric",0) ,nrow=3,ncol=3)


> x =  as.array(x)
> data <- list ("x")

Why are you making a list with a single character element? If you need  
to pass the matricx you just created in a list then try (and don't use  
"data" as the name :

dat <- list(x)



>
> if I add a line to above setting, then I can pass R2WinBugs:
>
> x[1,1] = 0
>
> If I manually input the NA array to WinBugs, I could get it running.  
> So my
> original data set has no problem with WinBugs.
> -- 


David Winsemius, MD
West Hartford, CT