> On Feb 29, 2016, at 6:24 AM, Fernando McRayearth wrote:
>
> Need to create ascii maps for 10 species by writing a loop. So i have to have
> the vectors ready in the Global Environment, and the "raster map" so the
> information can be added.
>
> when writing the loop I am using the "paste"
Thank you Jeff,
that sounds like the solution to my problem
but how would I do that code-wise?
could you please help?
--
View this message in context:
http://r.789695.n4.nabble.com/Loop-Help-tp4633558p4633701.html
Sent from the R help mailing list archive at Nabble.com.
_
@angel,
You can try append option in write.table
for e.g.
for(i in 1:20)
write.table(i,"out.txt",append=T,sep="\t",row.names=F,col.names=F)
This will help you save your all results by writing each results on
subsequent rows.
Hope this helps
Ozgur
>Hello Jim
>thank you so much for your respons
On Jun 18, 2012, at 5:47 AM, @ngel wrote:
I think that for now I'll keep it
There is no "it" in this message. Users of Nabble often fail to read
the POsitng Guide where it is requested that you include context.
as is and try to clean the data in excel.
Could someone please tell me how c
Then don't do that.
write.csv is designed to write a complete matrix or data frame in one call.
Combine your list of matrices into one (e.g. using sapply) and write that in
one call afterward rather than piecewise as you do the calculations.
-
Hello Jim
thank you so much for your response.
When I use write.csv, on the csv file is saved only the last loop
So when I write
results.matrix <- apply(degree_w(net.static[[i]]), 2, mean)
write.csv(results.matrix, file = "results.csv")
instead of getting a 550 line document with all loop result
What do you mean by "only the last j"? write.csv writes to a file you
specify and I assume that you are changing the file name if you are
making successive writes. You need to provide more detail.
On Mon, Jun 18, 2012 at 5:47 AM, @ngel wrote:
> I think that for now I'll keep it as is and try to
I think that for now I'll keep it as is and try to clean the data in excel.
Could someone please tell me how can I export the result to csv, since
write.csv exports only the last j?
Thank you so much in advance!
--
View this message in context:
http://r.789695.n4.nabble.com/Loop-Help-tp4633558p46
On 06/17/2012 08:50 AM, @ngel wrote:
Hello again and thank you all so much for the help. Well, I tried and did it
myself, here's what I wrote:
library(tnet)
net<- read.table("data.txt")
net<- as.tnet(net, type="longitudinal tnet")
loop<- range(net[,1])
net.static<- vector(length=as.integer(loop
Hello again and thank you all so much for the help. Well, I tried and did it
myself, here's what I wrote:
library(tnet)
net <- read.table("data.txt")
net <- as.tnet(net, type="longitudinal tnet")
loop <- range(net[,1])
net.static <- vector(length=as.integer(loop[2]-loop[1])+1, mode="list")
j <- 1
On 06/16/2012 07:41 AM, @ngel wrote:
Hello all,
I'm new here and new to R, but I have to admit I'm learning rather fast.
Right now I need to write a loop, and I don't seem to think I'm doing it
properly, judging by the errors I get! What I need to do is to insert my
data (csv-table) into a variab
Hi,
Do you mean printing the results of
degree_w(net.101031)
and
apply(net.101031, 2, mean)
in a loop?
see ?print to print the results
and
?cat as a suporting function.
For instance see the toy example below
for (i in 1:5){
print('')
cat("model",i,"\
al Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of David L Carlson
> Sent: Monday, May 21, 2012 12:30 PM
> To: 'Rui Barradas'; 'bdossman'
> Cc: r-help@r-project.org
> Subject: Re: [R] Loop Help
>
> Here is
s@r-
> project.org] On Behalf Of Rui Barradas
> Sent: Saturday, May 19, 2012 9:04 AM
> To: bdossman
> Cc: r-help@r-project.org
> Subject: Re: [R] Loop Help
>
> Hello,
>
> The error is that you are trying to use the number of rows of a
> character string.
> TOWERS[1], TOW
Hello,
The error is that you are trying to use the number of rows of a
character string.
TOWERS[1], TOWERS[2], etc, are not data frames. Use a print statement
before the line that throws the error to check it.
Your problem can be solved along the lines of what follows.
Note that I've put all
First, what was going wrong:
#this creates a character vector, not an object containing your data sets
TOWERS <- c("TOWER1","TOWER2","TOWER3","TOWER4","TOWER5","TOWER6","TOWER7")
for(i in 1:7){
# this creates a variable named "TOWER.i" (not "TOWER.1, TOWER.2,
..., TOWER.7)
# which will ge
On 17/06/2009, at 3:12 PM, dde...@sciborg.uwaterloo.ca wrote:
Hi all,
I'm stuck trying to get syntax correct for the follwing type of loop.
I would like to find the column with the largest value in a given row,
and create a new column with a categorical variable indicating which
column the high
17 matches
Mail list logo