[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 poi

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 be

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 informati

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 conti

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 control function, is it

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. E.g., > r <- rpois(100

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 tibco.

[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 inconsis

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)+ scale_colour_gradientn(colours=rainbow(9),breaks=breaks)

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 better at the Bioconductor

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, width

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 ragland

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 its makefiles, let me know wh

[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 kno

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 bring up this point: any c

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, s

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 <- dataset[dataset$ra