Re: [R] For loop output

2013-08-09 Thread David Carlson
iday, August 9, 2013 6:34 AM To: 'dcarl...@tamu.edu'; r-help@r-project.org Subject: RE: [R] For loop output To update on the use of this little string, I am trying to use it to automate files to be loaded into a raster stack. I think the issue I have with the string is related to the backslash

Re: [R] For loop output

2013-08-09 Thread Jan Kim
: -18.00832, 53.1, -38.00833, 39.1 (xmin, xmax, ymin, > ymax) > coord. ref. : +proj=longlat +ellps=WGS84 +no_defs > names : proj_current_arabica_pa.data.tmp.pa.tab_Full_GBM > min values :6 > max values :

Re: [R] For loop output

2013-08-09 Thread Jenny Williams
6 max values : 995 -Original Message- From: David Carlson [mailto:dcarl...@tamu.edu] Sent: 08 August 2013 18:04 To: Jenny Williams; r-help@r-project.org Subject: RE: [R] For loop output It's not clear how you are pl

Re: [R] For loop output

2013-08-08 Thread MacQueen, Don
If I understand the request correctly, here is an easy to follow example: (I'm using the first four letters as surrogates for the file names) (and assuming we want quotes at both the beginning and the end) > tmp <- letters[1:4] > tmp [1] "a" "b" "c" "d" > foo <- paste( "'", paste(tmp,collapse="'

Re: [R] For loop output

2013-08-08 Thread David Carlson
On Behalf Of Jenny Williams Sent: Thursday, August 8, 2013 10:06 AM To: 'r-help@r-project.org' Subject: [R] For loop output I am having difficulty storing the output of a for loop I have generated. All I want to do is find all the files that I have, create a string with all of the names in

Re: [R] For loop output

2013-08-08 Thread Jan Kim
On Thu, Aug 08, 2013 at 11:38:33AM -0500, Charles Determan Jr wrote: > Hi Jenny, > > Firstly, to my knowledge you cannot assign the output of cat to an object > (i.e. it only prints it). > Second, you can just add the 'collapse' option of the paste function. > > individual.proj.quote <- paste(ind

Re: [R] For loop output

2013-08-08 Thread Jan Kim
On Thu, Aug 08, 2013 at 04:05:57PM +0100, Jenny Williams wrote: > I am having difficulty storing the output of a for loop I have generated. All > I want to do is find all the files that I have, create a string with all of > the names in quotes and separated by commas. This is proving more difficu

Re: [R] For loop output

2013-08-08 Thread Charles Determan Jr
Hi Jenny, Firstly, to my knowledge you cannot assign the output of cat to an object (i.e. it only prints it). Second, you can just add the 'collapse' option of the paste function. individual.proj.quote <- paste(individual.proj, collapse = ",") if you really want the quotes individual.proj.quote

[R] For loop output

2013-08-08 Thread Jenny Williams
I am having difficulty storing the output of a for loop I have generated. All I want to do is find all the files that I have, create a string with all of the names in quotes and separated by commas. This is proving more difficult than I initially anticipated. I am sure it is either very simple o

Re: [R] for loop output

2012-10-17 Thread Sarah Goslee
At the end of the loop, the last output should be stored in int, so int will give it to you. You don't need the print(int) within the loop unless you like to verify that the loop is working. Sarah On Wed, Oct 17, 2012 at 2:16 PM, stats12 wrote: > Dear R users, > > In the code below, I am tryin

[R] for loop output

2012-10-17 Thread stats12
Dear R users, In the code below, I am trying to print the result of my loop function. The output first gives me the result for k=1, and then for k=1 and k=2. I only want the last output which is [,1] [,2] [1,] 0.1700065 0.5002659 [2,] 0.3080273 0.4954731 [3,] 0.4844886 0.454430