Displaying 3 results from an estimated 3 matches for "matnam".
2007 Mar 03
1
apply ? function doesnt create object
...308 95 27 1 0 2
[196,] 4942 200 27 1 0 1
the matrix ansblock27 contains answers to block 27
> ansblock27
error: object "ansblock27" not found
>
the code of the function:
getans = function(x=qids,bnr=1,type="block")
{
#generate name of matrix
matnam=paste("ans",type,as.character(bnr),sep="")
#display result matrix
show(assign(matnam,matrix(as.numeric(as.matrix(allans[(allans[, 3] %in
% x), , drop = FALSE])),ncol=dim(allans)[2])))
#create result matrix
assign(matnam,matrix(as.numeric(as.matrix(allans[(allans[, 3] %in%
x...
2007 Mar 03
1
function doesnt return/create object
...308 95 27 1 0 2
[196,] 4942 200 27 1 0 1
the matrix ansblock27 contains answers to block 27
> ansblock27
error: object "ansblock27" not found
>
the code of the function:
getans = function(x=qids,bnr=1,type="block")
{
#generate name of matrix
matnam=paste("ans",type,as.character(bnr),sep="")
#display result matrix
show(assign(matnam,matrix(as.numeric(as.matrix(allans[(allans[, 3] %in
% x), , drop = FALSE])),ncol=dim(allans)[2])))
#create result matrix
assign(matnam,matrix(as.numeric(as.matrix(allans[(allans[, 3] %in%
x...
2012 Jul 28
1
using save() to work with objects that exceed memory capacity
...pattern=objectname), file="matfile")
then I get the same positive result.
But now suppose I create a function
> saveobj <- function(objectname,objectfile)
+ {
+ save(list=ls(pattern=objectname),file=objectfile);
+ return()};
Then if I now try to save 'mat' by
> matname<-"mat"
> saveobj(matname,"matfile")
I do not get the same result; namely, the command 'load("mat")' retrieves
no objects. Why is this?
I'd be grateful for any help on either my specific questions, or
suggestions of a better ways to address the iss...