Hello,

I am attempting to write a function that assigns a value to a row or column
within the matrix that it runs on. I am, however, having trouble accessing
the row or column within this dynamic variable. I have looked through the
archives (nothing there) and read the rules for posting to this list. Please
help me out!

Here is a sample of the problem:


testMatrix = matrix(data=2, nrow=10, ncol=10)

testFunction = function (input)
{
    inputName <<- deparse(substitute(input))

    assign(inputName[1,], 4, envir = .GlobalEnv)
}

#this will give you the error
testFunction(testMatrix)


When I try to access "inputName[1,]" instead of "inputName," it fails. Does
anyone know how to do this?

Thanks in advance!!


Best Regards,

Dave Deriso
Undergraduate Researcher
UCSD Psychiatry

	[[alternative HTML version deleted]]

