Re: [R] create objects in a loop and adding sqlQuery content to them

2009-04-21 Thread Katharina May
I finally found the problem within my site_data object... this works well: snip site_data - sqlQuery(channel, select site_no from [biomass_data$] group by site_no)$site_no for(i in site_data) { assign(paste(site,i,_data,sep=), sqlQuery(channel, paste(select * from [biomass_data$] where

[R] create objects in a loop and adding sqlQuery content to them

2009-04-20 Thread Katharina May
Hi there, I've got a database or rather spreadsheet with several columns and rows. For one column named sites I want to loop through all possible values and retrieve all data out of the database where site = x and write it into an object named 'sitex_data'. Somehow I'm really missing

Re: [R] create objects in a loop and adding sqlQuery content to them

2009-04-20 Thread Steven McKinney
Hello -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Katharina May Sent: Monday, April 20, 2009 5:05 PM To: r-help@r-project.org Subject: [R] create objects in a loop and adding sqlQuery content to them Hi there,

Re: [R] create objects in a loop and adding sqlQuery content to them

2009-04-20 Thread Steven McKinney
#Here my first try [error message on the line within the loop, saying something like: # 'recursive indexing on level 2 failed'] sites_object_list - vector(list,99) If there's a site number larger than 99 this will be problematic. Sorry, this isn't correct - R will just increase

Re: [R] create objects in a loop and adding sqlQuery content to them

2009-04-20 Thread David Winsemius
On Apr 20, 2009, at 8:04 PM, Katharina May wrote: Hi there, I've got a database or rather spreadsheet with several columns and rows. For one column named sites I want to loop through all possible values and retrieve all data out of the database where site = x and write it into an object