I use SPLUS 7.0, enterprise. Windows Professional.
I have created the following script. It is pretty simple. It
queries a bigdata object for points bearing a particular line number. It gets
the coordinates of a particular point from that line and then queries the big
data object for all points within a given radius from those coordinates—it
places them into a bigdata object called pts.
The problem arises after I coerce the bigdata object into a
dataframe called pts.df so I can toss it into guiPlot. Here was my original
script:
SCRIPT FILE 1
plotAreaAroundLineNPoint = function(db,lnnum,ptnum,rad)
{selStmnt=c("Select * from theDB where
LineNumber =",lnnum)
lineSQL = paste(selStmnt,collapse= "
")
aLine = bd.sql(lineSQL,theDB=db)
xloc = aLine[ptnum,"X"]
yloc = aLine[ptnum,"Y"]
selStmnt = c("Select * from theDB where
(X-",xloc,")*(X-",xloc,")+(Y-",yloc,")*(Y-",yloc,")
< ",rad," * ",rad)
ptsSQL = paste(selStmnt,collapse="")
pts = bd.sql(ptsSQL,theDB=db)
pts.df = bd.coerce(pts)
guiPlot("Scatter",
Columns="X,Y,SigVal03,LineNumber",DataSet="pts.df")
}
plotAreaAroundLineNPoint(All.Ord,4039,60,10)
ERROR
SPlus reports that the object pts.df is not found.
I concluded last night that the bd.coerce statement
executing with out error but that, for some reason, pts.df is not being found
thereafter.
As I am new to guiPlot, I thought it might be the DataSet=”pts.df”
parameter. So I rewrote the file to just return pts.df as the result of the
function.
SCRIPT FILE 2
plotAreaAroundLineNPoint = function(db,lnnum,ptnum,rad)
{selStmnt=c("Select * from theDB where
LineNumber =",lnnum)
lineSQL = paste(selStmnt,collapse= "
")
aLine = bd.sql(lineSQL,theDB=db)
xloc = aLine[ptnum,"X"]
yloc = aLine[ptnum,"Y"]
selStmnt = c("Select * from theDB where
(X-",xloc,")*(X-",xloc,")+(Y-",yloc,")*(Y-",yloc,")
< ",rad," * ",rad)
ptsSQL = paste(selStmnt,collapse="")
pts = bd.sql(ptsSQL,theDB=db)
pts.df = bd.coerce(pts)
pts.df
}
plotAreaAroundLineNPoint(All.Ord,4039,60,10)
ERROR
Same error occurs.
And, I should see pts.df in the commands window after I
execute this function but I do not.
Any thoughts would be greatly appreciated.
Frank