Hi Ricardo
Assuming you have a good reason to use such approach (what are you
trying to do ultimately?), you can just increment your counter when
you get a good value, i.e.:
x <- numeric()
n <- 0
while (n < 10) {
u <- log(runif(1, -1, 2))
if (is.finite(u)) {
n <- n+1
x[n] <
Hi everybody.
Consider the following exampling code:
x=numeric()
for(i in 1:10){
u=runif(1,-1,2)
x[i]=log(u)
}
This code, in each interation, generates a random value in the (-1,2) interval
and then calculates the log of the value.
When the generated value is less than 0 the log pr
Hi,
Neighbours in this case were selected if they shared a boundary in the
voroni tesellation.
Best,
Monaly
On May 23, 2014 3:19 AM, "arun" wrote:
>
>
>
> HI Monaly,
> Thanks for the code and dput. But, I have a doubt about how you are
selecting the neigbours. Is there another dataset with the
On Thu, 22 May 2014 01:43:23 PM Luigi Marongiu wrote:
> Dear all,
> I have been plotting response variable (defined as "y" in the example
> below) from 4 groups (defined as "z" variable ) under 5 conditions
> (defined by the "x" variable). The formula used is: y ~ z+x.
> I can differentiate the di
I just tried the following:
require(deldir)
require(geometry)
set.seed(42)
bm <- data.frame(x=sample(1:82,800,TRUE),y=sample(1:82,800,TRUE))
del <- deldir(bm)
tri <- triang.list(del)
geodel <- delaunayn(bm)
length(tri) # Got [1] 1481
dim(geodel) # Got [1] 14813
So all seems to be in harmony
On 22/05/14 21:38, Baba Bukar wrote:
Dear all,
I have 100 observations sampled from poisson and negative binomial
distributions and i want set a hidden states for the observations, class
with zero and one {0,1}. Larger observations to be one and smaller
observations to be zero using R.
Can some
On 23/05/14 06:59, Claire wrote:
Thanks Bert,
Will post on r-sig-mixed-models list. Can't help it being in html
though as i sent the query via -email.
Huh? What do you mean by "-email"? Do you really mean "email" (without
the minus sign)? We *all* send our queries via email. This *is* emai
On 22/05/2014, 5:00 PM, Charles Geyer wrote:
For a Google Group about aster models, I want to say that people wanting
help are best advised to provide an example that works as
R CMD BATCH --vanilla foo.R
but I realize that many R users have zero idea of how to start R in any way
other than clic
I included runnable code to help demonstrate what I want to do but
Sorry in my rush I forgot to include this request:
I want to move the x axis labels to make the right end close to
the axis with a very small gap, and the bottom close to the
tick with an even smaller gap.
The staxlab function to
Hi Everyone,
I hope I did this correctly (I called my data frame ao) and Thank you very
much for the info about using dput(), I'm starting to understand all the
different things that can be done in R and I appreciate all the advice. I
must appologize in advance since my coding is quite long but h
You could have them spawn a vanilla R session using system instead of
the command line:
system('R CMD BATH --vanilla foo.R')
Or you could use the local argument to source to evaluate in a new
environment that does not inherit from the global environment:
source('foo.R', local=new.env(parent=pare
For a Google Group about aster models, I want to say that people wanting
help are best advised to provide an example that works as
R CMD BATCH --vanilla foo.R
but I realize that many R users have zero idea of how to start R in any way
other than clicking on an icon. Is there a way to start up th
I have thousands of files that need to be zipped. The files that need to be
zipped together have the same seven digit prefix e.g. 40111h1.
I am a novice at R-Studio and would appreciate some help on this matter.
Thanks!
--
View this message in context:
http://r.789695.n4.nabble.com/Zip-mult
Hi all,
I've been using the randomForest package on a dataset (described later) and
my problem is: even though I specify proximity= TRUE in the call I get a
NULL proximity matrix. Any thoughts on why that may happen?
Unfortunately I can't post my dataset, which is particularly problematic
here si
Thanks Bert,
Will post on r-sig-mixed-models list. Can't help it being in html though as i
sent the query via -email.
Cheers
Claire
> Date: Thu, 22 May 2014 09:29:44 -0700
> Subject: Re: [R] Post-hoc tests on linear mixed model give mixed results.
> From: gunter.ber...@gene.com
> To: c.word...@
Dear Laura,
I've modified vif() in the development version of the car package on R-Forge
so that it works with a wider variety of models, including gls models. Once
the package is built on R-Forge, which usually takes about a day, you can
install it via install.packages("car",
repos="http://R-Forg
I'm trying to plot a GWAS (in you will) with lined segments
representing an overall p-value for each gene. Here is my code:
skatg <- ggplot(comm, aes(x = position,y = p, colour = grey)) +
geom_point(size = 0.75) +
geom_segment(data=rare, aes(x = txStart,
Thank you! It seems to work.
Zuzana
On 22 May 2014 15:47, arun wrote:
> Hi,
>
> Check if this works:
> dat1 <- read.table("folder2.txt",
> header=TRUE,stringsAsFactors=FALSE,sep="\t",fileEncoding="UTF-16")
>
>
> 'data.frame':79 obs. of 6 variables:
> $ Documento: chr "6143066.17.4.12.DS
You need to provide reproducible examples if you want to get readers to
actually give you answers.
The two issues both come up from time to time and generally relate to
how the objective function is set up, though sometimes to options in the
call. However, "generally" really isn't good enough.
JN
Hi guys,
I have a piece of R code. Example code:
>R
>library(survival)
>ReadTable <- read.table("TestFile",header=F)
>CoxModel <-coxph(Surv(V1)~V2+V3+V4+V5,data=ReadTable)
>summary(CoxModel)
>plot(survfit(CoxModel))
I have to run this on 100 files, instead of 1 "TestFile", and get outputs of
10
#trying for both period-labeled and frequency labeled horizontal axis
rm(list=ls(all=TRUE))
install.packages('plotrix')
library(plotrix)
staxlab<-function(side=1,at,labels,nlines=2,top.line=0.5,
line.spacing=0.8,srt=NA,ticklen=0.03,adj=1,...) {
if(missing(labels)) labels<-at
nlabels<-length(lab
Wrong list! This does not concern R programming.
Post on the r-sig-mixed-models list instead in **PLAIN TEXT** rather than html.
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wis
Thanks very much, that worked superb!
On Thu, May 22, 2014 at 3:41 PM, Richard M. Heiberger wrote:
> ## Shane,
>
> ## This uses your color_list. Your other variables weren't included
> in the email
> ## so I invented some data.
>
> ## I recommend bwplot() using panel=panel.bwplot.superpose
>
>
Dear all,
I am quite new to R so apologies if I fail to ask properly. I have done a test
comparing bat species richness in five habitats as assessed by three methods. I
used a linear mixed model in lme4 and got habitat, method and the interaction
between the two as significant, with the random
Hi,
Try:
mat <-
as.matrix(read.csv("R.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t",row.names=1))
pdf("Hist_colwise.pdf")
lst1 <- lapply(seq_len(ncol(mat)),function(i) {x<- mat[,i,drop=FALSE]; hist(x,
main=paste("Histogram of", colnames(x)))})
dev.off()
##or may be this would be another way
Follow the link at the bottom of this message!
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Thu, May 22, 2014 at 8:31 AM, Monaly Mistry wrote:
> Hi,
Hello again,
I have found further depths of confusion concerning delaunay
triangulations to explore.
Here is the code I'm using to create the confusing results:
bm <- getbm(x) # a data.frame with 2 columns and 800 rows, values are
integers ranging from 1 to 82
del <- deldir(bm) # creating an obj
Hi,
Sorry I'm fairly new to R and I don't really understand using dput(), when
you say reproducible example do you mean the code with the output?
Best,
Monaly.
On Thu, May 22, 2014 at 4:03 PM, arun wrote:
> Hi,
>
> It would be helpful if you provide a reproducible example using ?dput().
>
>
On 22 May 2014, at 14:44 , Duncan Murdoch wrote:
> On 01/06/2013, 12:26 AM, Tiago V. Pereira wrote:
>> Hello, R users!
>>
>> I am struggling with the following problem:
>>
>> I need to compute a P-value for a mixture of two chi-squared
>> distributions. My P-value is given by:
>>
>> P = 0.5*p
## Shane,
## This uses your color_list. Your other variables weren't included
in the email
## so I invented some data.
## I recommend bwplot() using panel=panel.bwplot.superpose
## and I also show how to use boxplot()
## install.packages("HH") ## if necessary.
library(HH)
## install.packages
Hi,
I've written a code to determine the difference in score for a single
subject and its non-neighbours
o<-(ao[,c(13,5)]) ##this is the table with the relevant information
o<-na.omit(o) ##omitted data with NA
o<-o[!o$NestkastNummer %in% c(176,140,162,713),] ##removed neighbours
XO[7,1]<-abs((XO
Hi,
Check if this works:
dat1 <- read.table("folder2.txt",
header=TRUE,stringsAsFactors=FALSE,sep="\t",fileEncoding="UTF-16")
'data.frame': 79 obs. of 6 variables:
$ Documento: chr "6143066.17.4.12.DSC_0001.png"
"6143066.17.4.12.DSC_0001.png" "6143066.17.4.12.DSC_0001.png"
"6143066.17.
On 2014-05-22 13:08, Sarah Goslee wrote:
It's possible that a package is not available for your OS or version
of R, but you don't tell us either.
For the record, GNU/Linux R2110
That FAQ doesn't say that R is capable of downloading it for you: you
need to download the package manually, the
Dear list,
I would like to import into R studio txt files coming from Adobe photoshop.
These files contain different measures. The files are apparently common txt
files with columns separate by tab. However with common function
read.table the import process doesn't work and weird symbols appear o
Hi,
On Thu, May 22, 2014 at 8:48 AM, message wrote:
> Readers,
>
> As root user, from the command:
>
> install.packages()
>
> A dialogue window appears to select packages of interest. What to do if a
> specific packages exists on the cran page
> (http://cran.r-project.org/web/packages/available_p
On 22-05-2014, at 14:35, message wrote:
> On 2014-05-22 11:00, Berend Hasselman wrote:
uniroot(function(x) 5*x - 55, c(0, 10))
>>> Error in uniroot(function(x) 5 * x - 55, c(0, 10)) :
>>> f() values at end points not of opposite sign
>> I don’t believe this.
>> The error message says it all
Hello,
See inline.
Em 22-05-2014 13:35, message escreveu:
On 2014-05-22 11:00, Berend Hasselman wrote:
uniroot(function(x) 5*x - 55, c(0, 10))
Error in uniroot(function(x) 5 * x - 55, c(0, 10)) :
f() values at end points not of opposite sign
I don’t believe this.
The error message says i
Readers,
As root user, from the command:
install.packages()
A dialogue window appears to select packages of interest. What to do if
a specific packages exists on the cran page
(http://cran.r-project.org/web/packages/available_packages_by_name.html),
but not in the dialogue window of a reposi
On 01/06/2013, 12:26 AM, Tiago V. Pereira wrote:
Hello, R users!
I am struggling with the following problem:
I need to compute a P-value for a mixture of two chi-squared
distributions. My P-value is given by:
P = 0.5*prob(sqrt(chi2(1)) <= x) + 0.5*prob(sqrt(chi2(2)) <= x)
Isn't this simply
Dear all,
I have been plotting response variable (defined as "y" in the example
below) from 4 groups (defined as "z" variable ) under 5 conditions
(defined by the "x" variable). The formula used is: y ~ z+x.
I can differentiate the different z value using a call pch=c(symbol 1,
symbol 2, ...) but
Sarah's perhaps-too-clever comments had nothing to do with R, and everything to
do with the fact that Nabble misleadingly suggests to you that this mailing
list is hosted at their website. Very few of the participants on this EMAIL
LIST use Nabble, so we don't have any idea about the troubles yo
On 2014-05-22 11:00, Berend Hasselman wrote:
uniroot(function(x) 5*x - 55, c(0, 10))
Error in uniroot(function(x) 5 * x - 55, c(0, 10)) :
f() values at end points not of opposite sign
I don’t believe this.
The error message says it all.
5*0-55 ==> -55
5*10-55 ==> -5
The error states "o
Hi all
I am getting warning when I try to perform a bootstrap selection procedure on
variables (using boot.stepAIC function in the bootStepAIC package). I had
previously established which variables were collinear and kept the one which
had the lowest AIC following univariate regression on each
Hello,
thank you very much for your replies. I am almost done :-) but theres one
study left, where I only have sample size (not group size), mean values
and standarddeviations. Is there a way to compute cohens d from this data?
I thought it was correct to use measure="SMDH" in the escalc () func
You are probably encountering an annoying behaviour of sample(): when it is
given exactly one integer as an argument, it takes this as the upper limit of a
range.
a <- c(3,5)
sample(a,10, replace=TRUE)
#[1] 5 5 3 3 3 3 3 3 3 5
a <- c(5)
sample(a,10, replace=TRUE)
#[1] 2 1 3 1 1 3 4 5 1 4
#i.e
Hello,
Because there is no root of that function in the interval c(0, 10). Just
like the error message says.
Rui Barradas
Em 22-05-2014 11:28, message escreveu:
On 2014-05-20 10:00, r-help-requ...@r-project.org wrote:
--
Message: 32
Date: Mon, 19 May 2014 23:04:
On 22-05-2014, at 12:28, message wrote:
> On 2014-05-20 10:00, r-help-requ...@r-project.org wrote:
>> --
>> Message: 32
>> Date: Mon, 19 May 2014 23:04:27 +0100
>> From: Rui Barradas
>> To: message , r-help@r-project.org
>> uniroot(function(x) 5*x - 55, c(0, 20))
>
Sorry, I don't know enough about R to understand what you said.
But I don't think I need to understand it.
And secondly, my reason for my stupid recent post about not finding a
recent post was that I didn't notice that there was a little "1 2" in
the lower right hand corner meaning that I had t
On 2014-05-20 10:00, r-help-requ...@r-project.org wrote:
--
Message: 32
Date: Mon, 19 May 2014 23:04:27 +0100
From: Rui Barradas
To: message , r-help@r-project.org
uniroot(function(x) 5*x - 55, c(0, 20))
Why does this instruction fail if the interval is changed?
Hi all ,
I am having some URL's of facebook ,youtube ,
etc . I would like to applyk-mean clustering algorithm on
those URL's which gives me the most recomended URL's which
are visited frequently , I had seen some papers relat
Hi
Im producing boxplots based on factors and rearranging them by median (This
is for a Geochemistry element). Im giving each boxplot a unique color based
on its level (factor) name.
Im trying to produce a look up list to produce these colors as the order of
the boxplots will change from element
It's a well known quirk of sample that it changes behavior when the x argument
has length 1:
> replicate(10,sample(4:5, 1))
[1] 5 4 5 4 5 4 5 4 4 4
> replicate(10,sample(5:5, 1))
[1] 5 3 1 1 1 2 5 3 2 2
One workaround is to zap the offending branch inside sample:
> Sample <- function (x, size
Dear all,
I have 100 observations sampled from poisson and negative binomial
distributions and i want set a hidden states for the observations, class
with zero and one {0,1}. Larger observations to be one and smaller
observations to be zero using R.
Can someone please help?
Kind regards
Zakir
Please do that by going to:
https://stat.ethz.ch/mailman/listinfo/r-help
and fill in the required information.
Regards,
Kuldeep
Thanks and Regards,
Kuldeep Singh
On Wed, May 21, 2014 at 4:47 PM, Martina Marbà wrote:
> Hi,
>
> I would like to unsubscribe from the mailing list.
> Thanks
>
Also, the ?colMeans() route seems to be slightly faster (in cases with no
missing values).
set.seed(398)
x <- matrix(rnorm(1e4*2e4), ncol=2e4)
system.time(res1 <- mean(colMeans(x)))
# user system elapsed
#0.227 0.000 0.227
system.time(res2 <- mean(x))
# user system elapsed
# 0.
On Thu, 22 May 2014 09:54:13 AM Ragia Ibrahim wrote:
> Hi,
> kindly I want to select randomly and item from list of items. the list
> generated in a looping process. I used sample(mylist,1) it works fine.
> BUTsome times the list have only one item. that should be chosen in
this
> case since there
Hi,
I am not sure I understand the problem. Please provide a reproducible example
using ?dput().
mylist <- list(1:3, LETTERS[1:2], rnorm(4))
sample(mylist,1)
sample(mylist,1)
mylist1 <- list(1:2)
sample(mylist1,1)
#[[1]]
#[1] 1 2
sample(mylist1,1)
#[[1]]
#[1] 1 2
A.K.
On Thursday, May
Hi,
May be this helps:
ddNew <- transform(dd_1, CLASS= gsub("NA-|-NA","",paste(Class_a, Class_b,
sep="-")))
identical(ddNew, dd_2)
#[1] TRUE
A.K.
On Thursday, May 22, 2014 4:07 AM, Beatriz R. Gonzalez Dominguez
wrote:
Dear R-users,
I'd be very greatful if you could help me with the follo
Hi,
Please use the link (https://stat.ethz.ch/mailman/listinfo/r-help) to
unsubscribe.
A.K.
On Thursday, May 22, 2014 3:39 AM, Martina Marbà wrote:
Hi,
I would like to unsubscribe from the mailing list.
Thanks
--
--
Martina Marbà
[[alternative HTML version deleted]]
Dear R-users,
I'd be very greatful if you could help me with the following as after a
few tests I haven't still been able to get the right outcome.
I've got this data:
dd_1 <- data.frame(ID = c("1","2", "3", "4", "5"),
Class_a = c("a",NA, "a", NA, NA),
Class_b
Hi,
kindly I want to select randomly and item from list of items. the list
generated in a looping process.
I used sample(mylist,1) it works fine. BUTsome times the list have only one
item. that should be chosen in this case since there is no other one.
I found that sample return different item n
61 matches
Mail list logo