Re: [R] rJava is not loading

2013-06-06 Thread Prof Brian Ripley
On 06/06/2013 00:38, Dimitri Liakhovitski wrote: Hello! I installed rJava and am trying to load it. library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing

Re: [R] multivariate multilevel model

2013-06-06 Thread Jose Iparraguirre
Dear Patty, I would leave others to point you to the right packages, but I'd suggest you read this excellent R-based book: Data Analysis Using Regression and Multilevel/Hierarchical Models, by Andrew Gelman and Jennifer Hill (Cambridge University Press, 2006). Kind regards, José Prof. José

Re: [R] Send Mail R and Socket Connections

2013-06-06 Thread Uwe Ligges
On 05.06.2013 11:56, TwistedSkies wrote: Good Afternoon All, I am attempting to use the SendMailR function, I have checked with our I.T. department that I am using the correct server and I have the right permissions to connect and they have sent emails via this server but not through R and I

Re: [R] SPlus script

2013-06-06 Thread Scott Raynaud
Ok. I tried copying the original program, changing all _ to - and running in 3.0.1.  Still no error message or output.  It's a mystery to me. - Original Message - From: William Dunlap wdun...@tibco.com To: Scott Raynaud scott.rayn...@yahoo.com; r-help@r-project.org r-help@r-project.org

Re: [R] SPlus script

2013-06-06 Thread Ista Zahn
Hi Scott, As others have pointed out, all your script does is define functions. It doesn't generate output because those functions are never called. Basically you are missing part of the program--possibly in another file--that actually calls the sshc function. Best, Ista On Thu, Jun 6, 2013 at

Re: [R] lme function cannot find object

2013-06-06 Thread Ben Bolker
Pfeiffer, Steven pfeiffss at miamioh.edu writes: I have been using the function lme() from package 'nlme' for several months now without any problems. Suddenly, it cannot find a factor in my data. Is this a new bug of some kind? My code and output are below. Thanks for your help! -Steve

Re: [R] SPlus script

2013-06-06 Thread Scott Raynaud
Ok.  Now I see that the sshc function is not being called.  Thanks for pointing that out.  I'm not certain about the solution, however.  I tried putting call(sshc) at the end of the program, but nothing happened.  My memory about all of this is fuzzy.  Suggestions on how to call the function

Re: [R] basic sweave question

2013-06-06 Thread Michael Liu
Dear Ligges, *Well, * * * *1st, you should find the *Sweave.sty file, I am sure you can. 2nd, in the Latex configure menu, adding the path containing the Sweave.sty That will be OK. Best Wishes Guanhao Liu On Fri, Mar 22, 2013 at 6:56 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote:

[R] [R-pkgs] update to interval package

2013-06-06 Thread Fay, Michael (NIH/NIAID) [E]
Hi all, I just uploaded an update to the interval package that does NPMLE estimates of survival distribution and weighted logrank tests for interval censored data. The update now includes a confidence interval method for the survival that uses a modified bootstrap method. Mike

[R] Problem with marginal effects of a multinomial logistic regression

2013-06-06 Thread Leonard Moulin
Hi r-users, I try to calculate marginal effects of a multinomial logistic regression. To do this i use mlogit package and effects() function. Here is how the procedure works (source : effects() function of mlogit package) : data(Fishing, package = mlogit) Fish - mlogit.data(Fishing, varying =

[R] [R-pkgs] bpcp package for pointwise confidence intervals for a survival distribution

2013-06-06 Thread Fay, Michael (NIH/NIAID) [E]
Hi all, I just uploaded a new version of the bpcp package. It calculates confidence intervals for a survival distribution for right-censored data using the newly developed beta product confidence procedure. Previously developed methods can have substantial error rate inflation for the lower

[R] Error invalid graphics state using text()

2013-06-06 Thread danielw7
I'm using ssplot for drawing a map of Austria and colour the nine provinces regarding their share of employment. Now I wanted to add the figures in each province and failed miserably. Using the locator() and text() function caused the error message invalid graphics state. I try to show you what I

[R] SnpMatrix super slow to access cells when large

2013-06-06 Thread nickDIL
Dear snpStats users, I'm working with a large SnpMatrix object (roughly 5000 samples x 200K snps) and I've noticed using numerical accessors is extremely slow, e.g, see times below, takes over 1.5 seconds to retrieve a single cell in SnpMatrix format [1,1], versus 0.0 seconds to access the same

[R] Error invalid graphics state using text()

2013-06-06 Thread Daniel Wagner
Hi all! I'm using ssplot for drawing a map of Austria and colour the nine provinces regarding their share of employment. Now I wanted to add the figures in each province and failed miserably. Using the locator() and text() function caused the error message invalid graphics state.

Re: [R] Post hoc power analysis for mixed-effects models

2013-06-06 Thread Kota Hattori
Hi David, Thank you very much for your reply. I do understand your point. I was requested to do power analyses for null findings by reviewers. I think simulations would be an alternative choice given the validity of post hoc power analysis is questionable. The package, pamm does simulation.

Re: [R] Loop through variables and estimate effects on several outcomes

2013-06-06 Thread arun
Hi, Try: hsb2 - read.csv(http://www.ats.ucla.edu/stat/data/hsb2.csv;) varlist-names(hsb2)[8:10] fun2- function(varName){     res- sapply(varName,function(x){               model1- lm(substitute(cbind(female,race,ses)~i,list(i=as.name(x))),data=hsb2)           sM- summary(model1)          

Re: [R] combining two different matrizes

2013-06-06 Thread Berend Hasselman
On 05-06-2013, at 23:56, ThomasH thomas.hufnag...@gmx.de wrote: Hello together, this is ma first post, so please aplogize me if post this in the wrong section. I have problem concerning ma two matrizes. After a regressione and so on, I got two matrizes Matrixres contains the

[R] Autocorrelation and normal distribution of gaps for ping requests in an unstable network

2013-06-06 Thread Ramon Hofer
Hi all I have a powerline network connection which I'm investigating. The test network contains some nodes to which I ping from one host. The source host is always the same and I split the data to get files for each connection. A lot of ping requests get lost and I'm trying to plot an

Re: [R] SPlus script

2013-06-06 Thread Ista Zahn
Presumably something like r - sshc(50) print(r) But if you were getting output before than you already have a script that does something like this. It would be better to find it... Best, Ista On Thu, Jun 6, 2013 at 9:02 AM, Scott Raynaud scott.rayn...@yahoo.com wrote: Ok. Now I see that the

[R] generate simple function with pre-defined constants

2013-06-06 Thread Liviu Andronic
Dear all, Given: a - 2 b - 3 I'd like to obtain the following function: f - function(x) 2 + 3*x but when I do this: f - function(x) a + b*x ##f ##function(x) a + b*x the 'a' and 'b' objects do not get evaluated to their constants. How could I do that? Thanks, Liviu -- Do you know how to

Re: [R] rJava is not loading

2013-06-06 Thread Dimitri Liakhovitski
Thank you very much, Brian. It's clearly christal clear - but one needs a christal ball to realize that! :-) So I learned: architecture = bitness Dimitri On Thu, Jun 6, 2013 at 2:19 AM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote: On 06/06/2013 00:38, Dimitri Liakhovitski wrote: Hello!

Re: [R] rJava is not loading

2013-06-06 Thread Prof Brian Ripley
On 06/06/2013 15:52, Dimitri Liakhovitski wrote: Thank you very much, Brian. It's clearly christal clear - but one needs a christal ball to realize that! :-) So I learned: architecture = bitness On current Windows, yes. But not on OS X nor Linux nor Solaris nor FreeBSD It indicates the

[R] Not sure this is something R could do but it feels like it should be.

2013-06-06 Thread Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST)
Some colleagues nationally have developed a system which means they can pick the optimal sets of doses for a drug. The system could apply to a number of drugs. But the actual doses might vary. To try and explain this in terms that the average Joe on the street might understand if you have

Re: [R] combining two different matrizes

2013-06-06 Thread David Carlson
You didn't give us data, but this may give you enough to solve your problem: set.seed(42) nrows - 6 ncols - 5 mat1 - matrix(sample.int(100, 30), nrows, ncols) mat1 [,1] [,2] [,3] [,4] [,5] [1,] 92 70 83 397 [2,] 93 13 23 46 82 [3,] 29 61 40 73 98 [4,]

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Liviu Andronic
On Thu, Jun 6, 2013 at 4:48 PM, Liviu Andronic landronim...@gmail.com wrote: Dear all, Given: a - 2 b - 3 I'd like to obtain the following function: f - function(x) 2 + 3*x but when I do this: f - function(x) a + b*x ##f ##function(x) a + b*x the 'a' and 'b' objects do not get

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread arun
HI, Not sure I understand your question:  a - 2  b - 3  f1- function(x) a+b*x  f1(2) #[1] 8  f1(3) #[1] 11  f- function(x) 2+3*x  f(2) #[1] 8  f(3) #[1] 11 A.K.   sessionInfo() R version 3.0.0 (2013-04-03) Platform: x86_64-unknown-linux-gnu (64-bit) locale:  [1] LC_CTYPE=en_CA.UTF-8  

Re: [R] Not sure this is something R could do but it feels like it should be.

2013-06-06 Thread Marc Schwartz
On Jun 6, 2013, at 10:03 AM, Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) calum.polw...@nhs.net wrote: Some colleagues nationally have developed a system which means they can pick the optimal sets of doses for a drug. The system could apply to a number of drugs. But

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Liviu Andronic
On Thu, Jun 6, 2013 at 5:03 PM, arun smartpink...@yahoo.com wrote: HI, Not sure I understand your question: a - 2 b - 3 f1- function(x) a+b*x I don't want the function to depend on the objects a and b, but instead use the values of those objects (I do this within a function). Liviu

Re: [R] combining two different matrizes

2013-06-06 Thread Berend Hasselman
On 06-06-2013, at 17:04, David Carlson dcarl...@tamu.edu wrote: You didn't give us data, but this may give you enough to solve your problem: set.seed(42) nrows - 6 ncols - 5 mat1 - matrix(sample.int(100, 30), nrows, ncols) mat1 ….. newmat - matrix(rbind(as.vector(mat1),

Re: [R] SPlus script

2013-06-06 Thread Scott Raynaud
I actually had tried placing arguments in the call but it didn't work.   However, I did not think about writing it to a variable and printing.  That seems to have done the trick.  Funny, I don't remember having to do that before, but that's not surprising. Anyway, thanks for helping to

Re: [R] combining two different matrizes

2013-06-06 Thread arun
Perhaps this also helps: library(plyr)  do.call(rbind,alply(aperm(laply(list(A,B),as.matrix),c(1,3,2)),3)) #Using Berend's example    1  2  3  4  5 # [1,] -0.591 -0.934 -0.828  0.012 -0.683  #[2,]  1.000  6.000 11.000 16.000 21.000  #[3,]  0.027  1.324 -0.348 -0.223

Re: [R] List into table

2013-06-06 Thread David Winsemius
On Jun 5, 2013, at 1:49 AM, Andtrei89 wrote: Hi everyone, I want to open an XML file in R and it also works. But then I get a list of all numbers but it isn't in the type of numeric. I tried this: exampleData -

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-06 Thread Julio Sergio
Bert Gunter gunter.berton at gene.com writes: Another equivalent way to do it? f2 - function(c,nm = gamma,...) { probFunc - paste0(c,nm) more - list(...) function(x)do.call(probFunc,c(x,more)) } This avoids the explicit use of get() and force(), I believe, but are there

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Pascal Oettli
Hi, I am not sure what you are looking for. Here are some examples: foo - function(a,b,x) a + b*x foo function(a,b,x) a + b*x a - 2 b - 3 x - 0:10 foo(a,b,x) [1] 2 5 8 11 14 17 20 23 26 29 32 Or library(polynom) p1 - polynomial(c(a,b)) p1 2 + 3*x f1 - as.function(p1) f1(x) [1]

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread William Dunlap
Try the following: generateABFunction - function(a, b) { force(a) force(b) function(x) a*x + b } f12 - generateABFunction(1, 2) f53 - generateABFunction(5,6) f12(10:12) # get 12, 13, 14 f53(10:12) # get 56, 61, 66 See, e.g., yesterday's discussion under the

[R] Problem with marginal effects of a multinomial logistic regression

2013-06-06 Thread Leonard Moulin
Hi r-users, I try to calculate marginal effects of a multinomial logistic regression. To do this i use mlogit package and effects() function. Here is how the procedure works (source : effects() function of mlogit package) : data(Fishing, package = mlogit) Fish - mlogit.data(Fishing, varying =

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread John Kane
I think we really need to see the code. John Kane Kingston ON Canada -Original Message- From: sudha.krish...@marlabs.com Sent: Thu, 6 Jun 2013 06:37:41 + To: r-help@r-project.org Subject: [R] generating a bar chart with two axis for co-linear variable Hello Dimitris,

[R] Conditional coloring of area between curves

2013-06-06 Thread Roland Pape
Dear list, I have two time series of temperatures from different sites plotted in the same diagram and would like to color the area between the curves differently, dependent on whether site 1 is cooler than site 2 (colored let's say in blue) or warmer (red). While polygone() works fine to

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-06 Thread Bert Gunter
Sergio: Fair question. Unfair answer: My personal hangup. To my taste, get() makes R like a macro language instead of doing functional programming. force() makes me nervous about how I'm passing arguments. I won't attempt to defend either of these claims, so feel free to dismiss. Cheers, Bert

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Mark Leeds
hi bill: I understand what you're doing but, atleast for this case, I checked and you don't need the force this one. it works without it. so, I think the force requirement applies only when you're building them up with the lapply. but definitely I'm opened to clarification. thanks. On Thu,

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread William Dunlap
I said the force was 'required' in the sense that without it the function will fail to do what you want in some situations. It doesn't make sense to write a function that you know will fail sometimes when you know an easy way to make it work in all situations. Bill Dunlap Spotfire, TIBCO Software

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Mark Leeds
gotcha. thanks. On Thu, Jun 6, 2013 at 12:05 PM, William Dunlap wdun...@tibco.com wrote: I said the force was 'required' in the sense that without it the function will fail to do what you want in some situations. It doesn't make sense to write a function that you know will

Re: [R] generate simple function with pre-defined constants

2013-06-06 Thread Joshua Wiley
On Thu, Jun 6, 2013 at 9:05 AM, William Dunlap wdun...@tibco.com wrote: I said the force was 'required' in the sense that without it the function will fail to do what you want in some situations. With the Force on your side, functions always do what you want. Bill Dunlap Spotfire, TIBCO

Re: [R] Optim seems not to work properly in foreach

2013-06-06 Thread Simon Zehnder
Hi Ilai, after you sent this message I tried your code as well and it worked. As a result, I reconsidered the code written by me and of course also found the error in my function simulateEKOP. So for other people assuming errors or ill behavior in base functions: Forget it: these functions are

Re: [R] Conditional coloring of area between curves

2013-06-06 Thread Duncan Murdoch
On 06/06/2013 10:41 AM, Roland Pape wrote: Dear list, I have two time series of temperatures from different sites plotted in the same diagram and would like to color the area between the curves differently, dependent on whether site 1 is cooler than site 2 (colored let's say in blue) or

[R] RBloomberg: unable to use 'Corp' to fetch data

2013-06-06 Thread Chirag Maru
I am trying to get new Cusip (registered security) from old . This can be done in excel using BDP command. For example: =BDP(000361AJ Corp,ID_CUSIP), will give 000361AK1. Can this be done using RBloomberg? Any help will be much appreciated. Chirag Maru Senior Quantitative Analyst IRON

[R] OT: FAQ 7.31

2013-06-06 Thread Sarah Goslee
Or, how to tell thinking like humans from thinking like computers: www.smbc-comics.com/index.php?db=comicsid=2999 -- Sarah Goslee http://www.functionaldiversity.org __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Add prediction interval forest plot (package meta)

2013-06-06 Thread Bernd Weiss
Dear all, I am struggling to add a prediction interval to a forest plot that was created with forest.meta(), package meta. I checked the source of forest.meta() and realized that it is heavily relying on grid. I am lacking any experience with grid graphics. So, I am having difficulties to find

Re: [R] reshape2 issue

2013-06-06 Thread Adams, Jean
library(reshape2) ?cast Use acast or dcast depending on whether you want vector/matrix/array output or data frame output. Jean On Wed, Jun 5, 2013 at 9:35 AM, Bruce Miller batsnc...@gmail.com wrote: Hi all, I am revisiting using reshape2 to aggregate critter (bats) occurrences by time

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread arun
HI, May be this helps: dat1- read.table(sampledata.txt,header=TRUE,sep=,,stringsAsFactors=FALSE) pdf(Barplots.pdf)  lst1-lapply(seq_len(ncol(dat1)),function(i) {Ctdat- table(dat1[,i]);Ctdat1-(Ctdat/sum(Ctdat))*100;barplot(Ctdat1,ylim=c(0,100),xlab=colnames(dat1)[i],ylab=Relative

Re: [R] highlighted a certain time period on multiple plots

2013-06-06 Thread Adams, Jean
It is helpful if you provide your example data in a format that is easy for R-help readers to reproduce, for example, using the dput() function. For example, dat - structure(list(Date = c(1/1/2013, 1/2/2013, 1/3/2013, 1/4/2013, 1/5/2013, 1/6/2013, 1/7/2013, 1/8/2013, 1/9/2013, 1/10/2013,

[R] how to fit a glm model with all possible interactions between explanatory variables

2013-06-06 Thread Jack Luo
Hi, I am trying to find a way to fit a glm model with all the possible interaction terms between different variables, without typing all the X1:X2, X1:X3, in the formula, is there a way in R to do that? Thanks, -Jack [[alternative HTML version deleted]]

Re: [R] how to fit a glm model with all possible interactions between explanatory variables

2013-06-06 Thread David Winsemius
On Jun 6, 2013, at 12:52 PM, Jack Luo wrote: Hi, I am trying to find a way to fit a glm model with all the possible interaction terms between different variables, without typing all the X1:X2, X1:X3, in the formula, is there a way in R to do that? The * operator does that: ~ X1 * X2 *

Re: [R] how to fit a glm model with all possible interactions between explanatory variables

2013-06-06 Thread Bert Gunter
?formula -- Bert On Thu, Jun 6, 2013 at 12:52 PM, Jack Luo jluo.rh...@gmail.com wrote: Hi, I am trying to find a way to fit a glm model with all the possible interaction terms between different variables, without typing all the X1:X2, X1:X3, in the formula, is there a way in R to do that?

[R] Revolutions Blog: May Roundup

2013-06-06 Thread David Smith
Revolution Analytics staff write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are some articles related to R from

Re: [R] highlighted a certain time period on multiple plots

2013-06-06 Thread R. Michael Weylandt
On Thu, Jun 6, 2013 at 6:43 AM, Ye Lin ye...@lbl.gov wrote: Hey All, I have a dataset like this: DatedayVar1Var2Var3Obs1/1/2013Tue23411/2/2013Wed23521/3/2013Thu24631/4/2013 Fri24741/5/2013Sat24.5851/6/2013Sun24.9961/7/2013Mon25.31071/8/2013Tue25.711

Re: [R] generating a bar chart with two axis for co-linear variable

2013-06-06 Thread arun
HI, Not sure if this is what you wanted. pdf(BarplotsNew.pdf) library(plotrix) lst2-lapply(seq_len(ncol(dat1)),function(i){                     Ctdat- table(dat1[,i])                     Ctdat1-(Ctdat/sum(Ctdat))*100                     dat2-data.frame(Ctdat,Ctdat1,stringsAsFactors=FALSE)[,-3]    

Re: [R] SPlus script

2013-06-06 Thread Rolf Turner
On 07/06/13 03:19, Scott Raynaud wrote: I actually had tried placing arguments in the call but it didn't work. However, I did not think about writing it to a variable and printing. That seems to have done the trick. Funny, I don't remember having to do that before, but that's not

Re: [R] Not sure this is something R could do but it feels like it should be.

2013-06-06 Thread Jim Lemon
On 06/07/2013 01:03 AM, Polwart Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) wrote: Some colleagues nationally have developed a system which means they can pick the optimal sets of doses for a drug. The system could apply to a number of drugs. But the actual doses might vary.

[R] sample size determination - comparing means for different size samples

2013-06-06 Thread Rebecca Greenblatt
Looking to determine sample sizes for both my experimental and control groups (I want only a small portion of my participants in my experimental condition) in order to compare population means. I would be able to estimate standard deviation beforehand. I'm using the bpower function from the Hmisc

[R] Distance-based non-parametric ANOVA

2013-06-06 Thread Mikhail Umorin
Hello, I am comparing treatments by comparing within group to between group distances like described in MJ Anderson. 2001. A new method for non-parametric multivariate analysis of variance. Austral Ecology 26: 32 -- 46. The idea is to find the ratio of within group sum of distance^2 to

[R] error running mvabund package

2013-06-06 Thread andres.holz
Dear All, This is my first post, and probably (and hence apologies that) my question is very silly! I'm having issues with a the mvabund package (http://cran.r-project.org/web/packages/mvabund/index.html), and would be great to get some help! Here is the code (and files are attached):

Re: [R] sample size determination - comparing means for different size samples

2013-06-06 Thread David Winsemius
This is a duplicate question, right? On Jun 6, 2013, at 12:58 PM, Rebecca Greenblatt wrote: Looking to determine sample sizes for both my experimental and control groups (I want only a small portion of my participants in my experimental condition) in order to compare population means. I would

[R] lineplot.ci{sciplot}: Split x.factor label in two lines

2013-06-06 Thread Kumar Mainali
Some of the levels in my X factor has more than one word (e.g., North America) which I would like to split into two lines so that my plot does not get too wide. Any help is appreciated. lineplot.CI(x.factor = Continent, response = PCC.PrsPts, group = PointSource, data = master2, cex = 1.2, xlab

Re: [R] multilevel binary and ordered regression models

2013-06-06 Thread Rune Haubo
On 6 June 2013 00:13, Xu Jun junx...@gmail.com wrote: Dear r-helpers, I have two questions on multilevel binary and ordered regression models, respectively: 1. Is there any r function (like lmer or glmer) to run multilevel ordered regression models? Yes, package ordinal will fit such