[kepler-users] I'm new to Kepler

Derik Barseghian barseghian at nceas.ucsb.edu
Fri Apr 3 16:07:53 PDT 2009


Tommy,

Oops, you're right. I'm not sure of a way around having to statically  
declare how long the array will be in advance of running the workflow.

One solution would be to run two workflows in succession. The first  
would be a modified version of your workflow that instead ends with  
your String to Int going into a Counter actor that outputs to a File  
Writer. So this file would store the count of values found. Then in a  
second modified version of your current workflow, you could get the  
number of values via a File To Array Converter actor feeding into an  
Array Maximum actor.

Another option is to read the entire file in at the beginning of your  
workflow with the File Reader actor. You could then split it by end of  
line characters, and iterate over the resulting arrays to remove +'s.  
With this option you'll know how many values you'll be sending into  
the R actor from the start.

Let me know how it goes,
Derik



On Apr 3, 2009, at 12:58 PM, Tommy Stropp wrote:

> Hi Derik,
>
> Well, that kind of helped.
> If I configure the arrayLength parameter to be the exact number I  
> need, it does work. However, I don't know this number. It will be  
> different for different files, and when I set it to a number higher  
> than the number of values it will receive, I get no output. I  
> attached an ArrayLength actor to the SequenceToArray actor (so now I  
> have StringToInt -> SequenceToArray -> ArrayLength -> Display) and  
> it also gives me no output. It seems that the array isn't being  
> created.
> Any insight? Thanks again.
>
> - Tommy
>
>
>
>
>
> > CC: kepler-users at kepler-project.org
> > From: barseghian at nceas.ucsb.edu
> > To: tommystropp at hotmail.com
> > Subject: Re: [kepler-users] I'm new to Kepler
> > Date: Fri, 3 Apr 2009 12:36:28 -0700
> >
> > Hi Tommy,
> >
> > You might try a Sequence To Array actor between your String to Int  
> and
> > RExpression actors, so that you can feed all your values into the R
> > actor at once. You'd optimally want to configure the Sequence to  
> Array
> > ArrayLength parameter to be the number of values it's going to
> > receive. If it's the case that you don't know and therefore can't  
> set
> > that number before running the workflow, in this case for your
> > particular workflow, I believe you can just set ArrayLength to a  
> very
> > high number.
> >
> > Derik
> >
> > On Apr 3, 2009, at 11:44 AM, Tommy Stropp wrote:
> >
> > > I'm trying to make a histogram of values that I read from a file.
> > > Each value is on a separate line in the file and each line has a  
> lot
> > > of data that is separated by tabs.
> > > So what I have been able to do is extract the numbers I need,  
> but I
> > > haven't been able to figure out how to put them all together to  
> make
> > > a histogram. The way I have it now, Kepler makes a separate
> > > histogram for each value. Also, I only have that working with
> > > integers. I need to work with floating point numbers as well.
> > > I should also tell you that I know nothing when it comes to
> > > programming in R. Everything I am doing I am learning by myself.
> > > I've included a screenshot of what I have so far and a couple  
> sample
> > > files that can be opened with a text editor (the end of line
> > > character is \r\n).
> > > Any help would be greatly appreciated. Thanks in advance.
> > >
> > > - Tommy
> > >
> > >
> > >
> > > Internet Explorer 8 makes surfing easier. Get it now!
> > > <
> > > KeplerWorkflow
> > > .jpg
> > > >
> > > <
> > > file1_integers
> > > .gff
> > >  
> ><file2_doubles.gff>_______________________________________________
> > > Kepler-users mailing list
> > > Kepler-users at kepler-project.org
> > > http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
> >
>
> Create a cool, new character for your Windows Live™ Messenger. Check  
> it out




More information about the Kepler-users mailing list