I have a univariate binary (1,0) 230,000 records, I need to make 20,000
iterations of random sampling of a fixed size. Where I put the result of the
sum of selected records for each repetition
Thank's
_
of your life
On 3/11/2009 3:15 PM, René Pineda wrote:
I have a univariate binary (1,0) 230,000 records, I need to make 20,000
iterations of random sampling of a fixed size. Where I put the result of the
sum of selected records for each repetition
X - rbinom(23, 1, .5)
sample.sums - replicate(2,
I have a command that reads in some data:
x - read.csv(Sales2007.dat, header=TRUE)
Then I try to organize the data:
sc - split(x, list(x$Category, x$SubCategory), drop=TRUE)
Then I want to iterate through the data. I was able to get the following to run
on the R console:
for(i in
Kevin,
By default, many functions only *return* a result, they don't explicitly
*print* it. There is no difference in interactive mode, but there is in
batch mode (e.g., in loops). Use print() or cat() for explicit printing
to console.
for(i in 1:100)
{
cat(i,\n)
}
HTH,
Stephan
[EMAIL PROTECTED] wrote:
I have a command that reads in some data:
x - read.csv(Sales2007.dat, header=TRUE)
Then I try to organize the data:
sc - split(x, list(x$Category, x$SubCategory), drop=TRUE)
Then I want to iterate through the data. I was able to get the following to run
on the R
for(1 in 1:10)
{
print(i)
}
Mike
On Tue, Jul 15, 2008 at 1:11 PM, [EMAIL PROTECTED] wrote:
I have a command that reads in some data:
x - read.csv(Sales2007.dat, header=TRUE)
Then I try to organize the data:
sc - split(x, list(x$Category, x$SubCategory), drop=TRUE)
Then I
Oops, typo- sorry, should be
for(i in 1:10)
{
print(i)
}
Mike
On Tue, Jul 15, 2008 at 1:39 PM, Michael Rennie [EMAIL PROTECTED] wrote:
for(1 in 1:10)
{
print(i)
}
Mike
On Tue, Jul 15, 2008 at 1:11 PM, [EMAIL PROTECTED] wrote:
I have a command that reads in
If you read the help page, ?for, you might have seen under Value, that
'for', 'while' and 'repeat' return the value of the last
expression evaluated (or 'NULL' if none was), invisibly.
So if you want to see the values, print() them.
In general, from the first part of your message, it
Sorry I missed the print part. When nothing was output I assumed that nothing
happened.
Thank you.
Kevin
Erik Iverson [EMAIL PROTECTED] wrote:
If you read the help page, ?for, you might have seen under Value, that
'for', 'while' and 'repeat' return the value of the last
Thank you.
?for just gives me a + rompt indicating that I need to supply more input. The
same with ?while and ?repeat. Help(for) yelds:
help(for)
Error: unexpected ')' in help(for)
But thanks for the tip.
Keivn
Erik Iverson [EMAIL PROTECTED] wrote:
If you read the help page, ?for,
Sorry, I'm in ESS.
Try ?Control
[EMAIL PROTECTED] wrote:
Thank you.
?for just gives me a + rompt indicating that I need to supply more input. The
same with ?while and ?repeat. Help(for) yelds:
help(for)
Error: unexpected ')' in help(for)
But thanks for the tip.
Keivn
Erik Iverson
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2008 12:40 PM
To: Erik Iverson
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Iterations
Thank you.
?for just gives me a + rompt indicating that I need
On 16/07/2008, at 7:40 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Thank you.
?for just gives me a + rompt indicating that I need to supply more
input. The same with ?while and ?repeat. Help(for) yelds:
help(for)
Error: unexpected ')' in help(for)
But thanks for the tip.
13 matches
Mail list logo