Re: [R] \ escape sequence and windows path

2014-05-22 Thread Knut Krueger
Am 20.05.2014 19:03, schrieb Duncan Murdoch: I have no idea what you mean by a callback from utils. clipboard {utils} readClipboard function (format = 1L, raw = FALSE) .Call(C_readClipboard, format, raw) bytecode: 0x080d6c20 environment: namespace:utils I do not know whether it is an real

Re: [R] \ escape sequence and windows path

2014-05-22 Thread Knut Krueger
Sorry https://en.wikipedia.org/wiki/Callback_%28computer_programming%29 Knut __ 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

[R] Unsubscribe mailing list

2014-05-22 Thread Martina Marbà
Hi, I would like to unsubscribe from the mailing list. Thanks -- -- Martina Marbà [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] select randomly from a list

2014-05-22 Thread Ragia Ibrahim
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

[R] Combine factorial column intp a new column

2014-05-22 Thread Beatriz R. Gonzalez Dominguez
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 = c(NA, b, b,

Re: [R] Unsubscribe mailing list

2014-05-22 Thread arun
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à frees...@gmail.com wrote: Hi, I would like to unsubscribe from the mailing list. Thanks -- -- Martina Marbà     [[alternative HTML version

Re: [R] Combine factorial column intp a new column

2014-05-22 Thread arun
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 aguitatie...@hotmail.com wrote: Dear R-users, I'd be very greatful if you could help

Re: [R] select randomly from a list

2014-05-22 Thread arun
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

Re: [R] select randomly from a list

2014-05-22 Thread Jim Lemon
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 is

Re: [R] Mean of colMeans

2014-05-22 Thread arun
 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.46 

Re: [R] Unsubscribe mailing list

2014-05-22 Thread Kuldeep Singh
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à frees...@gmail.com wrote: Hi, I would like to unsubscribe from the mailing

[R] HMM states simulation

2014-05-22 Thread Baba Bukar
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

Re: [R] select randomly from a list

2014-05-22 Thread peter dalgaard
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,

[R] Boxplot colors

2014-05-22 Thread Shane Carey
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

[R] K-mean Clustering URL's and ranking them according to there recent visit .

2014-05-22 Thread Ashis Deb
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

Re: [R] solve scalar linear equation

2014-05-22 Thread message
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 ruipbarra...@sapo.pt To: message let...@openmailbox.org, r-help@r-project.org uniroot(function(x) 5*x - 55, c(0, 20)) Why does this

Re: [R] Second axis on bottom of graph

2014-05-22 Thread Hurr
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 to

Re: [R] solve scalar linear equation

2014-05-22 Thread Berend Hasselman
On 22-05-2014, at 12:28, message let...@openmailbox.org 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 ruipbarra...@sapo.pt To: message let...@openmailbox.org,

Re: [R] solve scalar linear equation

2014-05-22 Thread Rui Barradas
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

Re: [R] select randomly from a list

2014-05-22 Thread Boris Steipe
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.

Re: [R] Metafor: How to integrate effectsizes?

2014-05-22 Thread Verena Weinbir
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 ()

[R] Non-convergence in boot.stepAIC function with a logit model

2014-05-22 Thread Justin Michell
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

Re: [R] solve scalar linear equation

2014-05-22 Thread message
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

Re: [R] Second axis on bottom of graph

2014-05-22 Thread Jeff Newmiller
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

[R] multiple colour to symbols using brkdn.plot()

2014-05-22 Thread Luigi Marongiu
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 it

Re: [R] How to compute a P-value for a complex mixture of chi-squared distributions in R

2014-05-22 Thread Duncan Murdoch
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

[R] manual installation errors; install.package, R CMD

2014-05-22 Thread message
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

Re: [R] solve scalar linear equation

2014-05-22 Thread Rui Barradas
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

Re: [R] solve scalar linear equation

2014-05-22 Thread Berend Hasselman
On 22-05-2014, at 14:35, message let...@openmailbox.org 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

Re: [R] manual installation errors; install.package, R CMD

2014-05-22 Thread Sarah Goslee
Hi, On Thu, May 22, 2014 at 8:48 AM, message let...@openmailbox.org 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

[R] Fwd: problem importing apparently common txt files

2014-05-22 Thread zuzana zajkova
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

Re: [R] manual installation errors; install.package, R CMD

2014-05-22 Thread message
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,

Re: [R] Fwd: problem importing apparently common txt files

2014-05-22 Thread arun
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

[R] subsetting to exclude different values for each subject in study

2014-05-22 Thread Monaly Mistry
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

Re: [R] Boxplot colors

2014-05-22 Thread Richard M. Heiberger
## 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) ##

Re: [R] How to compute a P-value for a complex mixture of chi-squared distributions in R

2014-05-22 Thread peter dalgaard
On 22 May 2014, at 14:44 , Duncan Murdoch murdoch.dun...@gmail.com 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

Re: [R] subsetting to exclude different values for each subject in study

2014-05-22 Thread Monaly Mistry
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 smartpink...@yahoo.com wrote: Hi, It would be helpful if you provide a reproducible example

Re: [R] Voronoi-Diagrams in R

2014-05-22 Thread Raphael Päbst
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

Re: [R] subsetting to exclude different values for each subject in study

2014-05-22 Thread Bert Gunter
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

Re: [R] converting a matrix to array

2014-05-22 Thread arun
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 to look at

[R] Post-hoc tests on linear mixed model give mixed results.

2014-05-22 Thread Claire
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

Re: [R] Boxplot colors

2014-05-22 Thread Shane Carey
Thanks very much, that worked superb! On Thu, May 22, 2014 at 3:41 PM, Richard M. Heiberger r...@temple.eduwrote: ## Shane, ## This uses your color_list. Your other variables weren't included in the email ## so I invented some data. ## I recommend bwplot() using

Re: [R] Post-hoc tests on linear mixed model give mixed results.

2014-05-22 Thread Bert Gunter
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

[R] How do I move the axis labels precisely

2014-05-22 Thread Hurr
#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

[R] Running the cox model in R, through python or unix.

2014-05-22 Thread AoifeM
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 100 plots and

[R] Questions in R about optim( ) and optimize( )

2014-05-22 Thread Prof J C Nash (U30A)
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

Re: [R] Fwd: problem importing apparently common txt files

2014-05-22 Thread zuzana zajkova
Thank you! It seems to work. Zuzana On 22 May 2014 15:47, arun smartpink...@yahoo.com 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

[R] Adding segments to a dot plot in ggplot2

2014-05-22 Thread Kate Ignatius
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,

Re: [R] Variation Inflation factor for GLS

2014-05-22 Thread John Fox
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,

Re: [R] Post-hoc tests on linear mixed model give mixed results.

2014-05-22 Thread Claire
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:

[R] Random forest proximity measure

2014-05-22 Thread Maggie Makar
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

[R] Zip multiple files with same prefix?

2014-05-22 Thread mr_kirkwood
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:

[R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

2014-05-22 Thread Charles Geyer
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

Re: [R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

2014-05-22 Thread Greg Snow
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',

Re: [R] subsetting to exclude different values for each subject in study

2014-05-22 Thread Monaly Mistry
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

Re: [R] How do I move the axis labels precisely

2014-05-22 Thread Hurr
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

Re: [R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

2014-05-22 Thread Duncan Murdoch
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

Re: [R] Post-hoc tests on linear mixed model give mixed results.

2014-05-22 Thread Rolf Turner
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* email.

Re: [R] HMM states simulation

2014-05-22 Thread Rolf Turner
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

Re: [R] Voronoi-Diagrams in R

2014-05-22 Thread Rolf Turner
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 in

Re: [R] multiple colour to symbols using brkdn.plot()

2014-05-22 Thread Jim Lemon
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 different z

Re: [R] subsetting to exclude different values for each subject in study

2014-05-22 Thread Monaly Mistry
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 smartpink...@yahoo.com wrote: HI Monaly, Thanks for the code and dput. But, I have a doubt about how you are selecting the neigbours. Is there another

[R] Loop Issue

2014-05-22 Thread Ricardo Rocha
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

Re: [R] Loop Issue

2014-05-22 Thread Yvan Richard
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] - u