From: John Erb-Downward <jre_at_umich.edu>

Date: Mon, 4 Feb 2008 13:24:19 -0500

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html

and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 04 Feb 2008 - 18:29:39 GMT

Date: Mon, 4 Feb 2008 13:24:19 -0500

Thank you, thank you both! get() is exactly what I needed. I apologize for not putting in reproducible code. I'm not very good at this and was more worried that I would create problems that didn't exist (and the files I'm working with are too big). Again, thank you.

*-John
*

On Feb 4, 2008, at 11:50 AM, Bert Gunter wrote: ?get (maybe)

If this isn't it and you do not receive satisfactory replies, see the
Posting Guide for how to post a question with reproducible code so that
readers can understand what you mean (as opposed to me being the only
one

who doesn't understand you).

- Bert Gunter Genentech

On Feb 4, 2008, at 11:53 AM, <markleeds_at_verizon.net> <markleeds_at_verizon.net> wrote:

I think you need get. see ?get. i'm no

expert or i would give more specific info.

get takes something quoted and makes it an object.

Hello all,

I've run into what I bet is a silly problem; however, I've been trying to get around it now for a couple weeks and every time I think I have the answer it still doesn't work. So I apologize in advance if this is painfully obvious, but I've run out of ideas and would really appreciate any input.

My situation is this, I'm importing a number of tab delimited text files that contain chromatogram data that I am trying to display adjacent to a dendrogram. Since I look at multiple files I import them as file1, file2, file3, etc. To display them in the order that comes from the dendrogram I want to use order.dendrogram, which gives me a vector of numbers that is the order which I want the chomatograms to be displayed.

Here's the problem: I want to be able to set up a loop in which use "file" as the base name then concatenate the number that follows after it as the value at order.dendrogram[i] in a plot function. So something like:

assume there is a dendrogram called peak.dend

numberOfChromatograms<-20

i<-1

ord<-order.dendrogram(peak.dend)

while(i<=numberOfChromatograms){

plot(file[ord[i])

i<-i+1

}

I know that this particular plot function won't work, but for the purposes of this assume that it would if I just put in the number as opposed to ord[i]. But when I try this I get an error that "file" does not exist.

So I thought that the problem was concatenation. My solution was to use the paste function:

ord<-order.dendrogram(peak.dend)

ord

[1] 13 14 17 18 7 8 1 2 3 4 15 16 5 6 23 24 19 20 9 10 11
12 21 22

z<-paste("file",ord[1],sep="")

z

[1] "file13"

But when I try to plot this it won't work. "Ah ha!" I thought, "it's the quotes."

so I try to unquote it:

noquote(z)

[1] file13

Yes! But it still won't plot. For some reason the statement file13 is not getting evaluated. If I type in exactly plot(file13) it works. If I explicitly store file13 in z

z<-file13

then

plot(z)

it works.

But if I I do the following:

z<-noquote(paste("file",13,sep=""))

then

plot(z)

it will not plot (specifically it tells me that x and y are lengths differ which tells me that it's not evaluating the result of z, just inputting it as is).

I've naively tried eval(z), but I get the same result.

So I know this is a stupid problem and as soon as somebody tells me the answer I'm going to smack my head and say "Duh!", but right now I don't even know what terms to search for. Thanks in advance for any help.

*-John
*

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting- guide.html

and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 04 Feb 2008 - 18:29:39 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Mon 04 Feb 2008 - 18:30:12 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*