Re: [R] Batch importing data with respective naming

2009-04-29 Thread Taylor Hermes
It seems that this addition works, but has created just one object
called 'peak' with all the data from those 100 files.  I'd like each
file to have a corresponding object containing the data.

Thanks for your help!


On Tue, Apr 28, 2009 at 19:43, Zeljko Vrba zv...@ifi.uio.no wrote:
 On Tue, Apr 28, 2009 at 07:09:04PM -1000, Taylor Hermes wrote:

 I tried the following:

 Add this before for():

 peak - list()

 for (i in 1:100) {
       peak[[i]] - read.table(paste(i,--one--hist.txt, sep=), sep=,,
 header=TRUE)
 }




__
R-help@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] Batch importing data with respective naming

2009-04-28 Thread Taylor Hermes
I'm trying to import data from 100 text files and create data frames
that reflect their numbering.

The slow way would be to do the following:

peak1 - read.table(1--peak--hist.txt, sep=,, header=TRUE)
peak2 - read.table(2--peak--hist.txt, sep=,, header=TRUE)
peak3 - read.table(3--peak--hist.txt, sep=,, header=TRUE)
...

I tried the following:

for (i in 1:100) {
peak[[i]] - read.table(paste(i,--one--hist.txt, sep=), sep=,,
header=TRUE)
}

I receive an error saying object 'peak' not found, which leads me to
believe R is trying to look in 'peak' at to whatever position 'i' has
iterated.

How can I create these data frame objects with the numbering to match
the input text files?  That is to match the iterated 'i' of the loop?

Thanks for your help!

__
R-help@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] Nonlinear regression help

2009-04-23 Thread Taylor Hermes
I seek help with nonlinear regression for my data.  I've run intro
trouble fitting a model to my data as follows:

rate_parameter stable_population
75 1996.1277
100 1623.2979
125 1362.3475
150 1164.6738
175 1014.8227
200  892.0851
225  794.1844
250  710.1489
275  639.6738
300  578.0496
325  525.4965
350  479.4752
375  440.3050
400  402.4397

The rate_parameter here will be my independent variable which
affects the stable_population quantity in an agent-based simulation.

I can see that the plot of this data seems to fit an exponential
decay.  I would greatly appreciate if someone could help me out with
this task.  I've found the following info on this page helpful:
https://stat.ethz.ch/pipermail/r-help/2001-December/017330.html
yet, still unable to grasp what I need to do.

Thanks!

__
R-help@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.