Thanks to Mauricio and Elizabeth. If anyone's curious the solution is below:<div>---</div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><p style="font-family: arial, sans-serif; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; font: normal normal normal 11px/normal Monaco; color: rgb(6, 24, 153); ">
<span style="color: rgb(0, 0, 0); ">name.temp</span><-paste(<span style="color: rgb(176, 21, 11); ">'name'</span>,<span style="color: rgb(0, 0, 0); "> </span>as.character(<font color="#065218">i</font>),<span style="color: rgb(0, 0, 0); "> </span><span style="color: rgb(176, 21, 11); ">'.csv'</span>,<span style="color: rgb(0, 0, 0); "> sep</span>=<span style="color: rgb(176, 21, 11); ">''</span>)</p>
<p style="font-family: arial, sans-serif; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; font: normal normal normal 11px/normal Monaco; color: rgb(6, 24, 153); ">#This will create the table, tab-separated</p>
<p style="font-family: arial, sans-serif; font-size: 13px; color: rgb(34, 34, 34); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 4px; font: normal normal normal 11px/normal Monaco; "><span style="color: rgb(6, 24, 153); ">write.table(</span>YOURTABLEHERE<span style="color: rgb(6, 24, 153); ">,</span>file<span style="color: rgb(6, 24, 153); ">=</span>name.temp<span style="color: rgb(6, 24, 153); ">,</span>sep<span style="color: rgb(6, 24, 153); ">=</span><span style="color: rgb(176, 21, 11); ">"\t"</span><span style="color: rgb(6, 24, 153); ">,</span> row.names<span style="color: rgb(6, 24, 153); ">=</span><span style="color: rgb(195, 136, 32); ">FALSE</span><span style="color: rgb(6, 24, 153); ">,</span> quote<span style="color: rgb(6, 24, 153); ">=</span><span style="color: rgb(195, 136, 32); ">FALSE</span><span style="color: rgb(6, 24, 153); ">)</span></p>
</span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">---<br><br></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Thanks again,<br><br>-A</span></div>
<div><br><div class="gmail_quote">On Tue, Sep 6, 2011 at 11:49 AM, Ashkaan Fahimipour <span dir="ltr"><<a href="mailto:ashkaanf@gmail.com">ashkaanf@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey all, I'm hoping someone will be able to help me. I have a list of 178 food web matrices in R -- I want to export these individually using the 'write.csv' function, but I also want to use the loop number to name each subsequent .csv file. I have a regional matrix called 'master3' grouped as a list, I can pull out local food webs using master3[[i]] where i denotes the i'th food web. I want to export each individual locality as a csv file named after the corresponding loop number (e.g. for master[[4]], output 'master_4.csv') Something like:<div>
<br></div><div><div>for (i in 1:length(master3)) {</div><div> write.csv(master3[[i]], file = master_i)</div><div>}</div></div><div><br></div><div>But that doesn't seem to make R happy. Any help at all would be appreciated, I'd like to avoid doing it manually.</div>
<div><br></div><font color="#888888"><div>-Ashkaan</div>
</font></blockquote></div><br></div>