Re: [R] Setting two default CRAN servers under Windows/RStudio

2015-06-25 Thread Sigbert Klinke
Hi, I tried the following: local({r <- getOption("repos") r["CRAN"] <- "http://local.cran.server/"; r["MIRROR"] <- "http://cran.mirror/"; options(repos=r) }) But: R seems always to take the "CRAN" entry first, therefore I put our local mirror there. If a R session starts

[R] Collecting output of regressions in an intelligent way

2015-06-25 Thread Francesca
Dear R Contributors I am asking for some suggestions on how to organize output of a series of regressions and tests in an intelligent way. I estimate a series of Var models with increasing numbers of lags and the perform a Wald test to control Granger Causality: I would like to learn a way to do it

Re: [R] Broken links (???) in R-FAQ

2015-06-25 Thread Jim Lemon
Hi Chel Hee, The last link (for FAQ 7.39) is dead and the domain (rwiki.sciviews.org) is not there either. Jim On Thu, Jun 25, 2015 at 3:45 AM, Chel Hee Lee wrote: > Could you kindly check if the following links are working fine in the R-FAQ > page at

Re: [R] set par options once for entire R session

2015-06-25 Thread Jim Lemon
Hi Martin, Depending upon what device parameters you want to set, you can write a wrapper for the device call that includes the parameters: my.x11<-function() { x11(family="sans",font=2) } Then just call the wrapper instead of the device function. You could make a little package with all of the

Re: [R] Plotting legend outside of chart area

2015-06-25 Thread Antonio Serrano via R-help
First, you have to increase the bottom margin to have enough space for the legend. You do it like this: par( mar = c(6,4,4,2) ) >From R help: ‘mar’ A numerical vector of the form ‘c(bottom, left, top, right)’ which gives the number of lines of margin to be specified on

Re: [R] Collecting output of regressions in an intelligent way

2015-06-25 Thread Adams, Jean
Francesca, You don't provide any example data, so the code that I am provided is untested, but here is one way to put your commands into a loop. # define range of p values you want to use ps <- 6:10 # create an empty list to collect the results waldchi <- vector("list", length(ps)) # loop throu

Re: [R] R lattice : labeling of matrix groups of different size with strips

2015-06-25 Thread R codeplayer
Hi Duncan, thank you very much for your help. Originally, I thought that it is possible to use a different data representation and then to automatically create the plots and strips in lattice. Based on your suggestion, I could write the code for an annotated levelplot of the two groups (code i

[R] CCA package

2015-06-25 Thread javad bayat
Dear R users; I am using CCA package to calculate the correlation between two data set. Every time that I run my codes, I get the following error; "the leading minor of order 5 is not positive definite". Please help me to fix it. Many thanks. -- Best Regards Javad Bayat M.Sc. Environment Engineer

[R] quantile of a discrete random variable

2015-06-25 Thread L... L...
Dear all, is there a general method for calculating the quantile of a discrete random variable? If yes, is there a R function to do this? Best regards Marcelo Lamack [[alternative HTML version deleted]] _

Re: [R] Broken links (???) in R-FAQ

2015-06-25 Thread Chel Hee Lee
Thank you so much, Jim. Yes, I also see that the wiki (rwiki.sciviews.org) is not found. Chel Hee Lee On 15-06-25 04:54 AM, Jim Lemon wrote: Hi Chel Hee, The last link (for FAQ 7.39) is dead and the domain (rwiki.sciviews.org) is not there either. Jim On Thu, Jun 25, 2015 at 3:45 AM, Chel

Re: [R] Broken links (???) in rw-FAQ

2015-06-25 Thread Chel Hee Lee
Thank you so much, David! I also confirmed that the link moved is not found. Chel Hee Lee On 15-06-24 04:15 PM, David Winsemius wrote: On Jun 24, 2015, at 10:52 AM, Chel Hee Lee wrote: Could you also kindly check the following links in the rw-FAQ manual at

Re: [R] Cannot Connect to R server

2015-06-25 Thread David Winsemius
On Jun 24, 2015, at 6:49 PM, karlmalone32 wrote: > My RStudio has a wired problem. When I run library(the package I have > successfully installed), RStudio has no response. After endless waiting, an > error message comes out saying R cannot connect to the R server. Both my R > and RStudio are per

Re: [R] quantile of a discrete random variable

2015-06-25 Thread David L Carlson
There is a function called quantile() that provides 9 methods of computing quantiles, three of which are appropriate for discontinuous data. Type ?quantile at the command prompt for details. - David L Carlson Department of Anthropology Texas A&M University Co

Re: [R] quantile of a discrete random variable

2015-06-25 Thread David Winsemius
On Jun 25, 2015, at 7:26 AM, L... L... wrote: > Dear all, is there a general method for calculating the quantile of a > discrete random variable? If yes, is there a R function to do this? The `quantile` function would seem to be the first place to go. It may depend on the object-type of your r

Re: [R] CCA package

2015-06-25 Thread David Winsemius
Dear Javad; Please stop copying r-help-owner with messages intended for r-help. David (one of the several moderators) On Jun 25, 2015, at 4:48 AM, javad bayat wrote: > Dear R users; > I am using CCA package to calculate the correlation between two data set. > Every time that I run my codes, I

[R] quantile of a discrete random variabel --- again

2015-06-25 Thread L... L...
I thank all for your reply. My question was not well formulated. I will do it again: Suppose that the random variable X is discrete with probability mass function (pmf) F (binomial, poisson, ) not necessarily available in R. Is there a general method to get the quantiles (as qbinom, qpois, ...

Re: [R] quantile of a discrete random variabel --- again

2015-06-25 Thread Bert Gunter
Well, presumably you have the pmf and can create a matrix of the form: (where mypmf is your pmf) x <- seq_len(1000) ## or whatever your discrete support sorted in increasing order ## for individual quantile q: max(x[cumsum(mypmf(x)) <= q] ) ## This probably could be vectorized for a vector of q

Re: [R] Extracting data from a file containing data

2015-06-25 Thread Peter Tuju
I have the data as attached. For each nino region, I want to get the mean of the seasons January and February (JF), March, April and may (MAM), June, July and August (JJA), and October, November and December (OND) as columns of each nino regions. and have my result as;For example; For NINO1.2Yea

Re: [R] Extracting data from a file containing data

2015-06-25 Thread David L Carlson
First, create a variable (a factor) for your categories (did you really intend to exclude September?). Then use the aggregate function. ?factor ?aggregate - David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -O

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
What happened to September? Just disregard? Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jun 25, 2015 at 11:40 AM, Peter Tuju wrote: > I have the data as attached. For each nino region, I want t

Re: [R] Extracting data from a file containing data

2015-06-25 Thread jim holtman
try this: > input <- read.table("C:\\Users\\jh52822\\Downloads\\Nino_indices.txt" + , header = TRUE + , as.is = TRUE + ) > # create factors > input$season <- factor(c(rep("JF", 2), rep("MAM", 3), rep("JJA", 3) + , NA, rep("OND", 3

[R] dplyr, summarize_each, mean - dealing with NAs

2015-06-25 Thread Dimitri Liakhovitski
Hello! I have a data frame md: md <- data.frame(x = c(3,5,4,5,3,5), y = c(5,5,5,4,4,1), z = c(1,3,4,3,5,5), device1 = c("c","a","a","b","c","c"), device2 = c("B","A","A","A","B","B")) md[2,3] <- NA md[4,1] <- NA md I want to calculate means by device1 / device2 combinat

Re: [R] dplyr, summarize_each, mean - dealing with NAs

2015-06-25 Thread Dimitri Liakhovitski
Just want to clarify - I know how to do it using base R. I just want to figure out how to do it in dplyr. This i what I want to achieve: myvars <- c("x","y","z") aggregate(md[myvars], by = md[c("device1","device2")], mean, na.rm = T) Thank you! On Thu, Jun 25, 2015 at 4:25 PM, Dimitri Liakhovits

Re: [R] dplyr, summarize_each, mean - dealing with NAs

2015-06-25 Thread Dimitri Liakhovitski
I found the answer: md %>% group_by(device1, device2) %>% summarise_each(funs(mean(., na.rm = TRUE))) On Thu, Jun 25, 2015 at 4:35 PM, Dimitri Liakhovitski wrote: > Just want to clarify - I know how to do it using base R. I just want > to figure out how to do it in dplyr. This i what I want to a

[R] prmatrix and print.matrix

2015-06-25 Thread Therneau, Terry M., Ph.D.
The help page for prmatrix states that it only exists for backwards compatability and strongly hints at using print.matrix instead. However, there does not seem to be a print.matrix() function. The help page for print mentions a zero.print option, but that does not appear to affect matrices.

[R] Codependents Cycles

2015-06-25 Thread Rafael Costa
Dear R users, Where can I find the codes to test codependent cycles? This test was presented on paper "Codependents Cycles" (Vahid and Engle, 1997). I am looking forward any help. Thanks in advance , Rafael Costa. [[alternative HTML version deleted]] _

Re: [R] dplyr, summarize_each, mean - dealing with NAs

2015-06-25 Thread David Winsemius
On Jun 25, 2015, at 1:25 PM, Dimitri Liakhovitski wrote: > Hello! > > I have a data frame md: > >md <- data.frame(x = c(3,5,4,5,3,5), y = c(5,5,5,4,4,1), z = > c(1,3,4,3,5,5), > device1 = c("c","a","a","b","c","c"), device2 = > c("B","A","A","A","B","B")) >md[2,3] <- NA >m

[R] how to change the "ff" properties of a "ff"-related R object after the original "ff" output folder has been moved

2015-06-25 Thread Shi, Tao via R-help
Hi all, I'm new to "ff" package through the using Bioconductor package "crlmm". Here is my problem: I've created a few R objects (e.g. an CNSet) using crlmm based on my data and save them in a .RData file. crlmm heavily uses ff package to store results on a local folder. For certain reasons

Re: [R] R lattice : labeling of matrix groups of different size with strips

2015-06-25 Thread Duncan Mackay
I am not sure that changing the aspect ratio by using levelplot(plotMatrix[,,2], aspect = 1/0.6, ...) will do the job as I seem to remember doing something like that when first looking at your problem. There were unwanted side effects using grid.arrange is the

Re: [R] 'class(.) == **' [was 'Call to a function']

2015-06-25 Thread Steven Yen
Thanks to all for the help. I have learned much about "inherit" and "class". I like to know about one additional option, and that is to use a calling parameter without the quotation marks, similar to the linear regression syntax: lm(data=mydata,weights=wt) Below is a simple set of codes to ca

Re: [R] how to change the "ff" properties of a "ff"-related R object after the original "ff" output folder has been moved

2015-06-25 Thread David Winsemius
On Jun 25, 2015, at 4:04 PM, Shi, Tao via R-help wrote: > Hi all, > > I'm new to "ff" package through the using Bioconductor package "crlmm". Here > is my problem: > > I've created a few R objects (e.g. an CNSet) using crlmm based on my data and > save them in a .RData file. crlmm heavily u

[R] VCD package - Setting confidence interval for oddsratio and loddsratio

2015-06-25 Thread My List
All: I am using oddsratio() and loddsratio() from the VCD package. How do I set the confidence interval for the these functions.I want to set it 95 %.I have thought that the odds ratio functions don't need confidence interval for calculation , but yes for interpretation they use confidence interva

Re: [R] R lattice : labeling of matrix groups of different size with strips

2015-06-25 Thread R codeplayer
Hi Duncan, thank you so much for your help. 2015-06-26 4:16 GMT+02:00 Duncan Mackay : > I am not sure that changing the aspect ratio by using > levelplot(plotMatrix[,,2], > aspect = 1/0.6, > ...) I already experimented with different values of aspect but I new

Re: [R] 'class(.) == **' [was 'Call to a function']

2015-06-25 Thread David Winsemius
On Jun 25, 2015, at 7:48 PM, Steven Yen wrote: > Thanks to all for the help. I have learned much about "inherit" and "class". > I like to know about one additional option, and that is to use a calling > parameter without the quotation marks, similar to the linear regression > syntax: > > lm(d

[R] extracting significant response variables

2015-06-25 Thread adeela uaf
Hi, My experiment consist of factorial structure with 25 genotypes and 3 salinity levels ( 25 cross 3) each with 3 replications. 14 responses were taken from the experiment and I applied MANOVA but I am applying discriminant analysis to know which response variable has significant impact on the se

Re: [R] 'class(.) == **' [was 'Call to a function']

2015-06-25 Thread Steven Yen
Thanks Davis. But actually, the line is legitimate: if (inherits(wt,what="character")) wt<-data[,wt] because, coming down with wt being characters, the part wt<-data[,wt] then picks up variables data$wt. The call wmean(mydata,wt="weight") actually goes OK. I was hoping to figure out a