s-news
[Top] [All Lists]

A problem in plot(x,y)

To: <s-news@lists.biostat.wustl.edu>
Subject: A problem in plot(x,y)
From: "Dr.Takashi Kikuchi" <takashi.kikuchi@st-hughs.oxford.ac.uk>
Date: Mon, 20 Jan 2003 11:35:05 -0000
Organization: University of Oxford

Dear S-Plus user

I experience en error message of "Error in plot.xy("plot"): Cannot find x and y in list" by a following codes. It may be a simple problem but I can not find the cause.  I make a matrix with two columns corresponding to X and Y components and then extract each component to give it in a plot( X, Y) command. I think it must properly work. Please suggest the cause of the error.  I use Windows2000 and S-Plus 2000 professonal version.

Best regrads,

Takashi Kikuchi

University of Oxford

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Making a sequence

n.sub_ seq(from=10, to=200, by=10)

# Definition of a function

l.ratio_ function(n.sub){

# constants

Mk_5*10^6

M1_Mk*0.57

M2_Mk*0.29

M3_Mk*0.10

c_ 4*10^3

l.mean1_ -1.833

l.sd1_  0.4469

l.mean2_ -1.505

l.sd2_  0.4635

l.mean3_ -0.1564

l.sd3_ 0.6959

# core expressions

l.smlt1_ rnorm(n.dat, mean=l.mean1, sd=l.sd1)

ub.var1_ var(l.smlt1)

rt1_ (1.63-mean(l.smlt1))/sqrt(ub.var1*(n.sub-1))

bft1_ M1/(1+exp(rt1))

l.smlt2_ rnorm(n.dat, mean=l.mean2, sd=l.sd2)

ub.var2_ var(l.smlt2)

rt2_ (1.63-mean(l.smlt2))/sqrt(ub.var2*(n.sub-1))

bft2_ M1/(1+exp(rt2))

l.smlt3_ rnorm(n.dat, mean=l.mean3, sd=l.sd3)

ub.var3_ var(l.smlt3)

rt3_ (1.63-mean(l.smlt3))/sqrt(ub.var3*(n.sub-1))

bft3_ M1/(1+exp(rt3))

# Output

t.bft_bft1+bft2+bft3-c*n.sub

return(t.bft)}

 

# Calculation of the function

ans_ lapply(n.dat, l.ratio)

 

# Making a matrix for x-y plot

n.subm_ as.matrix(n.sub)

ansm_ as.matrix(ans)

btdat_cbind(n.subm, ansm)

btdat

# Plotting

plot(btdat[,1], btdat[,2])

<Prev in Thread] Current Thread [Next in Thread>