Hello,
Can you please post the output of
dput(all) # if all is small
dput(head(all, 30)) # if all is big
in a mail?
Hope this helps,
Rui Barradas
On 1/24/2018 4:28 PM, Francisca R. Souza Pereira wrote:
Hi,
I'm not a programmer, so I have a question about R functions,
I run the Random Fo
Hi,
I'm not a programmer, so I have a question about R functions,
I run the Random Forest regression models, but
I would like to run the random forest model 1000 times with different
random sample set. to check the uncertainty of the regression model
estimates.
exemple of data:
##
On 03-Mar-2013 16:29:05 Angelo Scozzarella Tiscali wrote:
> For example, I want to simulate different populations with same mean and
> standard deviation but different distribution.
>
> Il giorno 03/mar/2013, alle ore 17:14, Angelo Scozzarella Tiscali ha scritto:
>> Dear R friends,
>>
>> I'd lik
For example, I want to simulate different populations with same mean and
standard deviation but different distribution.
Il giorno 03/mar/2013, alle ore 17:14, Angelo Scozzarella Tiscali ha scritto:
> Dear R friends,
>
> I'd like to generate random sample (variable size and range) without a
>
Angelo Scozzarella Tiscali tiscali.it> writes:
>
> Dear R friends,
>
> I'd like to generate random sample (variable size and range) without a
specified distribution but with
> given mean and standard deviation.
>
> Could you help me?
>
The problem is underspecified, so no, we can't.
A
Dear R friends,
I'd like to generate random sample (variable size and range) without a
specified distribution but with given mean and standard deviation.
Could you help me?
thanks in advance
Angelo
__
R-help@r-project.org mailing list
https://stat.e
On Apr 5, 2012, at 12:00 AM, Daisy Englert Duursma wrote:
random selection of cells in raster based on distance from xy
locations
Hi,
I am trying to sample a raster for random cells that occur within a
specific distance of point locations. I have successfully found
multiple
ways of doing
Hello,
>
> #Here is how I have tried to sample but it is not sampling from the right
> part of the list
>
> bg<- z_nonna[sample(1:length(z_nonna), 5000, replace=FALSE)]
>
You are sampling from the length of z_nonna, with no guarantee that they are
indices to unique list elements.
Try this.
#
random selection of cells in raster based on distance from xy locations
Hi,
I am trying to sample a raster for random cells that occur within a
specific distance of point locations. I have successfully found multiple
ways of doing this but have memory issues with very large datasets. To
overcome
Okay thanks to your help I figured it out and stuck the code in a function:
df.sample.exIDs = function(main.df, sample1.df, n, ID1.name, ID2.name) {
main.ID1.notin.ID2 = main.df[!main.df[,ID1.name] %in%
sample1.df[,ID2.name],]
sample2.df = main.ID1.notin.ID2[sample(nrow(main.ID1.notin.ID2), si
On Mar 30, 2012, at 8:17 AM, inkhorn wrote:
Okay, here's some sample code:
ID = c(1,2,3,"A1",5,6,"A2",8,9,"A3")
fakedata = rnorm(10, 5, .5)
main.df = data.frame(ID,fakedata)
results for my data frame:
main.df
ID fakedata
1 1 5.024332
2 2 4.752943
3 3 5.408618
4 A1
Okay, here's some sample code:
ID = c(1,2,3,"A1",5,6,"A2",8,9,"A3")
fakedata = rnorm(10, 5, .5)
main.df = data.frame(ID,fakedata)
results for my data frame:
> main.df
ID fakedata
1 1 5.024332
2 2 4.752943
3 3 5.408618
4 A1 5.362838
5 55.158660
6 64.658235
7
On Mar 29, 2012, at 4:22 PM, inkhorn wrote:
When I use that exact syntax
Which you didn't include as context. Please read the Posting Guide.
(with the ID variable names
You are the one the offered "ID" as the column name.
in quotes within the
square brackets after a comma) it just doesn
When I use that exact syntax (with the ID variable names in quotes within the
square brackets after a comma) it just doesn't work. Also, I'm looking for
a random sample, not all possible rows with ID values that don't match the
second data frame.
--
View this message in context:
http://r.789695.
On Mar 29, 2012, at 2:37 PM, inkhorn wrote:
Hello,
Let's say I've drawn a random sample () from a large data frame
(main.df), and I want to create a second random sample (sample2.df)
where
the values in its ID column *are not* in the equivalent ID column in
the
first sample (sample1.df).
Hello,
Let's say I've drawn a random sample (sample1.df) from a large data frame
(main.df), and I want to create a second random sample (sample2.df) where
the values in its ID column *are not* in the equivalent ID column in the
first sample (sample1.df). How would I go about doing this?
In other
On Wed, Feb 08, 2012 at 06:17:40AM -0800, n wrote:
> Hi,
>
> How can I draw a random sample from a truncated distribution (especially
> lognormal)?
>
> I found the functions for truncated normal but not for many other
> distributions.
Hi.
A variable Y with a log-normal distribution may be obtain
Hi,
How can I draw a random sample from a truncated distribution (especially
lognormal)?
I found the functions for truncated normal but not for many other
distributions.
Thanks
Nikhil
--
View this message in context:
http://r.789695.n4.nabble.com/Random-sample-from-truncated-distributions-tp
Here is an example of what I think the original poster wanted to
achieve.
> rnorm(10)
[1] -1.2165869 -0.4698460 -0.4209811 -1.4856052 0.3765774 -1.3822470
[7] 0.2818458 0.5500957 -1.1474455 -1.2221257
> x <- .Random.seed
> runif(10)
[1] 0.5610780 0.5911841 0.5868183 0.3833801 0.7397059 0.497
Hi Xiaoxi,
Take a look at the following:
> set.seed(123)
> rnorm(10)
[1] -0.56047565 -0.23017749 1.55870831 0.07050839 0.12928774 1.71506499
[7] 0.46091621 -1.26506123 -0.68685285 -0.44566197
> rnorm(10)
[1] 1.2240818 0.3598138 0.4007715 0.1106827 -0.5558411 1.7869131
0.4978505
[8]
?set.seed is what you're looking for
Xiaoxi Gao wrote:
Hello R users,
Here is my question about generating random sample. How to set the random seed to
recreate the same random numbers? For example, 10 random numbers is generated from
N(0,1), then "runif(10)" is used.What if I want to get the
;s the word... imbue it."
- Jubal Early, Firefly
From:
Xiaoxi Gao
To:
R Help
Date:
11/08/2010 03:59 PM
Subject:
[R] Random Sample
Sent by:
r-help-boun...@r-project.org
Hello R users,
Here is my question about generating random sample. How to set the random
seed to recreate the
Hello R users,
Here is my question about generating random sample. How to set the random seed
to recreate the same random numbers? For example, 10 random numbers is
generated from N(0,1), then "runif(10)" is used.What if I want to get the same
10 random numbers when I run runif(10) again? Is i
Hi Joris,
sorry for the late response. But I was away for a couple of days. Apparently
i also did something wrong than.
Now both these loops are working as they suppose to.
Thanks again for all the help.
Assa
On Fri, Jul 9, 2010 at 17:05, Joris Meys wrote:
> Could you elaborate?
>
> Both
>
>
Could you elaborate?
Both
x <- 1:4
set <- matrix(nrow = 50, ncol = 11)
for(i in c(1:11)){
set[,i] <-sample(x,50)
print(c(i,"->", set), quote = FALSE)
}
and
x <- 1:4
set <- matrix(nrow = 50, ncol = 11)
for(i in c(1:50)){
set[i,] <-sample(x,11)
print(c(i,"->", set)
Hi Joris,
I guess i did it wrong again.
but your example didn't work either. I still get the error massage.
but replicate function just fine. I can even replicate the whole array
lines.
THX
Assa
On Thu, Jul 8, 2010 at 15:20, Joris Meys wrote:
> Don't know what exactly you're trying to do, but
On Jul 8, 2010, at 2:04 AM, Assa Yeroslaviz wrote:
Hello R users,
I'm trying to extract random samples from a big array I have.
I have a data frame of over 40k lines and would like to produce
around 50
random sample of around 200 lines each from this array.
this is the matrix
ID
Don't know what exactly you're trying to do, but you make a matrix
with 11 columns and 50 rows, then treat it as a vector. On top of
that, you try to fill 50 rows/columns with 50 values. Off course that
doesn't work. Did you check the warning messages when running the
code?
Either do :
for(i in
Hello R users,
I'm trying to extract random samples from a big array I have.
I have a data frame of over 40k lines and would like to produce around 50
random sample of around 200 lines each from this array.
this is the matrix
ID xxx_1c xxx__2c xxx__3c xxx__4c xxx__5T xxx__6T xxx__7T xx
subset of the data.frame?
Thanks
Krystyna
> Date: Tue, 28 Apr 2009 14:33:22 +0200
> From: lig...@statistik.tu-dortmund.de
> To: kagola...@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] Random Sample with Unique function
>
> In order to use stratified sampling, eithe
la...@hotmail.com
CC: r-help@r-project.org
Subject: Re: [R] Random Sample with Unique function
In order to use stratified sampling, either try to implement it yourself
or use the "sampling" package and its function strata() as in:
s1 <- strata(cc, stratanames="ID", size
In order to use stratified sampling, either try to implement it yourself
or use the "sampling" package and its function strata() as in:
s1 <- strata(cc, stratanames="ID", size=rep(1, 20), method="srswr")
then you will get 1 observation for each ID. Note that it is not
important to use "with re
Dear R-users
I have a dataset of 243 lines with replicate information for 20 different
individuals (ID).
I would like to randomly sample this dataset 100 times with a selection of
unique IDs in each sample.
First to create a random sample I have;
cc<-read.table(blah.blah.blah)
names(cc)
[1]
Hi Andy,
You forgot a comma at the end:
people[sample(1:nrow(people), 10, replace = TRUE),]
Now it should work as expected :-)
HTH,
Jorge
On Tue, Jan 27, 2009 at 9:44 PM, Andy wrote:
> I would like to create a random sample of the rows of a data frame that
> is larger than the number of row
I would like to create a random sample of the rows of a data frame that
is larger than the number of rows in the data frame. With an individual
vector, this is easy using select(variable, number, replace = TRUE). I
looked on-line I found some guides to sample from a data frame using
indexing, but I
35 matches
Mail list logo