Re: variable call problem in asreml-R

From: Butler, David <David.Butler_at_DPI.QLD.GOV.AU>
Date: Thu, 8 Nov 2007 15:18:19 +1000

Xianming, for(i in 4:5) out.asr <- asreml(Data[[i]] ~ ...., data=Data) seems to work at the command line but may well fail in a function because asreml() does not yet fully respect R scoping rules. You could either assign the data column to a local variable or add a dummy column to the data frame, ie for(i in 1:n) { y <- Data[[i]] ## or Data$y <- Data[[i]] out.asr <- asreml(y ~ ......, data=Data) } Some things in this regard have been addressed so it may be worthwile using the latest version for R which you can get from Dave. ________________________________ From: ASReml users discussion group [mailto:ASREML-L@AGRIC.NSW.GOV.AU] On Behalf Of Xianming Wei Sent: Thursday, 8 November 2007 10:01 AM To: ASREML-L@AGRIC.NSW.GOV.AU Subject: variable call problem in asreml-R Hi all, I have a list of explanatory variables that I'd like to use them one by one as fixed in a mixed model. Instead of typing each one's name when it's called, I'd like to use something like[[i]] for the ith column, which works OK with lm(). But with ASReml-R, I got: Error in '[.data.frame'(data.frame, , v) : undefined columns selected. Any suggestion appreciated. Regards, Xianming DISCLAIMER: For details of our e-mail disclaimer, please read it at BSES Limited Disclaimer ________________________________ This email and any files transmitted with it are confidential and intended solely for the person or entity to whom they are addressed. If you are not the intended recipient of this email, you should not read, copy or otherwise use it, or disclose its contents to anyone else.If you received this email in error please notify BSES Limited immediately by return email, destroy all copies of the email, any delete if from your system. Recipients should rely on their own systems for detecting computer viruses or other material that may corrupt files or systems. ________________________________ ********************************DISCLAIMER**************************** The information contained in the above e-mail message or messages (which includes any attachments) is confidential and may be legally privileged. It is intended only for the use of the person or entity to which it is addressed. If you are not the addressee any form of disclosure, copying, modification, distribution or any action taken or omitted in reliance on the information is unauthorised. Opinions contained in the message(s) do not necessarily reflect the opinions of the Queensland Government and its authorities. If you received this communication in error, please notify the sender immediately and delete it from your computer system network.
Received on Mon Nov 08 2007 - 15:18:19 EST

This webpage is part of the ASReml-l discussion list archives 2004-2010. More information on ASReml can be found at the VSN website. This discussion list is now deprecated - please use the VSN forum for discussion on ASReml. (These online archives were generated using the hypermail package.)