Re: [R] subset data using a vector

2015-11-24 Thread DIGHE, NILESH [AG/2362]
Jim & Michael: I really appreciate your guidance in creating the function I wanted. I took suggestions from both of you and was able to complete this function. I had to split the process into two functions as listed below. I just thought to send the results to the list in case someone might

Re: [R] Ensure distribution of classes is the same as prior distribution in Cross Validation

2015-11-24 Thread Max Kuhn
Right now, using `method = "cv"` or `method = "repeatedcv"` does stratified sampling. Depending on what you mean by "ensure" and the nature of your outcome (categorical?), it probably already does. On Mon, Nov 23, 2015 at 7:04 PM, TJUN KIAT TEO wrote: > In the caret train

Re: [R] Plotting Example Fail

2015-11-24 Thread Timothy D. Legg
Thank you for your suggestions. I am quite grateful to understand that plotting is reliable and consistent in R. I had believed that this was based on a built-in dataset within the R programming language, just as the New Zealand volcano is. I look forward to further participation in R as I

Re: [R] Plotting Example Fail

2015-11-24 Thread Boris Steipe
... or read about set.seed() and use it. B. On Nov 24, 2015, at 2:58 PM, William Dunlap wrote: > rpois(100, 5) gives a different set of random numbers each time it is > called, so if you want repeatable results compute it once and use its > value in the calls to plot.

Re: [R] Plotting Example Fail

2015-11-24 Thread Bert Gunter
But please spend some time with an R tutorial or two (An Intro to R ships with R; there are many more on the Web) before you post further here. Many such elementary confusions and time wasted -- both yours and ours -- will be avoided if you do so. Cheers, Bert Bert Gunter "Data is not

[R] Plotting Example Fail

2015-11-24 Thread Timothy D. Legg
Hello, I am quite new to R and have high expectations for my future with it. R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) I have stepped back to an earlier tutorial and found an odd

Re: [R] Plotting Example Fail

2015-11-24 Thread William Dunlap
rpois(100, 5) gives a different set of random numbers each time it is called, so if you want repeatable results compute it once and use its value in the calls to plot. E.g., r <- rpois(100, 5) plot(table(r), type="h", col="red", lwd=10, main="hello") Bill Dunlap TIBCO Software wdunlap

[R] Non-linear fit?

2015-11-24 Thread Judson
I need to fit a sinusoidal curve to x-y data that exhibits a sinusoidal pattern. The curve will be: y = a*sin(w*x +p) ; where I need to get the best fit choice for the parameters a, w, and p. Could anyone suggest which package and routine I should use? I have less than 1000 data

Re: [R] RGL Problem

2015-11-24 Thread Stefan Evert
> On 24 Nov 2015, at 13:32, Duncan Murdoch wrote: > >> Perhaps it would make sense always to use the well-known standard XQuartz >> paths on Mac and only consider other locations if explicitly asked for by >> the user? > > If rgl is using non-standard features in

Re: [R] Probing a protein sequence alignment in R

2015-11-24 Thread Bert Gunter
Wrong list (mostly). You would do much better at the Bioconductor list, https://support.bioconductor.org/ Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Nov 24, 2015 at 9:04 AM, debra

Re: [R] Probing a protein sequence alignment in R

2015-11-24 Thread Boris Steipe
One way would be to use the biostrings and msa packages from bioconductor. Use AAStringSet() to collect your sequences, and (e.g.) msaMuscle() to align them. Then use BStringset() to extract the subrange you need, and e.g. table to look at the distributions... table(BStringSet(, start=50,

[R-es] transformar número en R

2015-11-24 Thread Sergio Castro
Buenas tardes, Estoy extrayendo un dato de una web y el separador de miles es el ".", que es el separador decimal en R. He intentado reemplazaro por el caracter, para convertirlo en ´numérico de R, vacío pero no me deja. Lo que he intentado es lo siguiente: > a<-"17.691.700" # valor que obtengo

Re: [R-es] transformar número en R

2015-11-24 Thread Sergio Castro
Muchas gracias, con esto ya funciona perfectamente. Un saludo. El día 24 de noviembre de 2015, 17:44, Carlos J. Gil Bellosta escribió: > a <- "17.691.700" # valor que obtengo de la web > a <- as.numeric(gsub("\\.", "", a)) > > "sub and gsub perform replacement of the

[R] Probing a protein sequence alignment in R

2015-11-24 Thread debra ragland via R-help
I have 15 protein sequences of 99 amino acids each. After doing some looking around I have found that there are several ways you can read sequences into R and do pairwise or multiple alignments. I, however, do not know how to probe changes at specific positions. For instance, I would like to

Re: [R] Probing a protein sequence alignment in R

2015-11-24 Thread Boris Steipe
Well ... that depends on what the best solution will turn out to be. filling a matrix with the characters, or even substr() would be alternative "lightweight" appraoches. B. On Nov 24, 2015, at 12:43 PM, Bert Gunter wrote: > Wrong list (mostly). You would do much

Re: [R-es] transformar número en R

2015-11-24 Thread Carlos J. Gil Bellosta
a <- "17.691.700" # valor que obtengo de la web a <- as.numeric(gsub("\\.", "", a)) "sub and gsub perform replacement of the first and all matches respectively." Además, ten cuidado con ".": es el comodín para cualquier caracter. Por eso a <- "17.691.700" sub(".", "", a) da lo que da (y no es

Re: [R] improve my ggplot look

2015-11-24 Thread Alaios via R-help
I am giving to the community two examples My code currently look like: breaks<-c(0,0.01,0.05,0.08,0.1,0.15,0.2,0.3,0.5,0.7,0.9,1) ggmap(mp, darken = 0) + geom_point(aes(Longitude, Latitude, colour =Divergence), data = PlotPoints, size =10)+

Re: [R] subset data using a vector

2015-11-24 Thread Jim Lemon
Hi Nilesh, I simplified your code a bit: fun1<-function (dataset, plot.id, ranges2use, control) { m1 <- strsplit(as.character(ranges2use), ",") dat1 <- data.frame() row_check_mean <- NA row_check_adj_yield <- NA x <- length(plot.id) for (i in 1:x) { cat(i,"\n") dat1 <-

Re: [R] improve my ggplot look

2015-11-24 Thread Alaios via R-help
Dear Dennis, it would be better if not plotting the lon and lat. Keeping it blank is better for the aesthetics of my map. I am not sure how I can give a reproducible example herebut I want to   ggmap(mp, darken = 0) + geom_point(aes(Longitude, Latitude, colour=Divergence), data = PlotPoints,

Re: [R] RGL Problem

2015-11-24 Thread Duncan Murdoch
Some comments on the second part of your message. On 23/11/2015 7:45 AM, Stefan Evert wrote: On 23 Nov 2015, at 11:50, Duncan Murdoch wrote: The OSX binary version of rgl on CRAN is ancient. You'll need to reinstall it from source for a current one. Since you