Re: [R] Breaking y- axis using gap.barplot

2015-02-10 Thread riviverma
Thank you for the reply. Can I have a gap starting from 50 instead of 120 so that the values with lower frequency can show up more predominantly? > Hi reviverma, > I think your problem is that you have chosen the wrong gap, as it cuts > out all of the small bars. Try this: > > gap.barplot(hdata$

Re: [R] How to solve this complex equation

2015-02-10 Thread JS Huang
Hi, The solution x to the equation is the parmater lambda = x/2 of a Poisson distribution with probability of 0.05 for the number of occurrence 2 or fewer. -- View this message in context: http://r.789695.n4.nabble.com/How-to-solve-this-complex-equation-tp4702997p4703070.html Sent from the R

[R] Hausman test for Conditional Logit

2015-02-10 Thread Yann le Polain de Waroux
Dear all, I am running a conditional logit model on migration choices using the "mclogit" package, and I would like to test the independence of irrelevant alternatives (IIA), as it is a restrictive assumption of those models. The mclogit package does not offer the Hausman test, which seems to

[R] Error in xvardef

2015-02-10 Thread Carolina Llanos
Dear all, First of all, thanks for any help. I am a new R user and I am trying to do some plots using xpose 4. When I indicate to R to do this, for example: DATA CHECKOUT MENU \main\data checkout 1: Return to previous menu -> 2: Numerically summarize the covariates 3: Histograms of the covaria

Re: [R] assignment of categorical variables to matrix/table

2015-02-10 Thread JS Huang
Hi, Try this with three category variables. > A [1] "Baby" "Kid" "Teenager" "Adult""Mature" > B [1] "Male" "Female" > C [1] "PST" "MST" "CST" "EST" > expand.grid(Age=A, Sex=B, Zone=C) AgeSex Zone 1 Baby Male PST 2 Kid Male PST 3 Teenager Male PS

Re: [R] confint.merMod(method="boot") {lme4} with user supplied FUN to bootMer fails

2015-02-10 Thread Ben Bolker
Torbjørn Håkan Ergon ibv.uio.no> writes: > > Dear list, > > I'm trying to supply a summary function to confint.merMod(method="boot") > {lme4} but get persistent > errors. The following example generates the errors: > > > fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy) > > test = f

Re: [R] function that calculates using preceding records

2015-02-10 Thread JS Huang
Hi, Here is an implementation: > data <- read.table("tree.txt",header=TRUE,sep=",",stringsAsFactors=FALSE) > data treecode yearrw d 1 TC149 2014NA8 2 TC149 2013 0.080 NA 3 TC149 2012 0.125 NA 4 TC149 2011 0.120 NA 5 TC149 2010 0.125 NA 6 T

Re: [R] library(Rcmdr) sh: otool: command not found

2015-02-10 Thread John Fox
Dear varin sacha, This problem presumably will also arise if you try to load the tcltk package directly via library(tcltk) and has been discussed before on the R-SIG-Mac email list, for example at . The problem is fixed in the

Re: [R] Ranjan Maitra's comment "Re: Variance is different in R vs. Excel?

2015-02-10 Thread Ranjan Maitra
Thanks! Interesting! Perhaps there was a patch to Excel later on, because otherwise, this does not explain things. Anyway, regardless, good to know that the long-standing issue has been fixed. The title of your e-mail post is amusing! Ranjan On Tue, 10 Feb 2015 18:09:22 -0600 Ronald Wyllys w

Re: [R] How to unzip a .gz file

2015-02-10 Thread Henrik Bengtsson
Not clear if you need to: 1. decompress /home/file.gz, or 2. read the content of /home/file.gz into R. For (1) you can use `gunzip` at the command line, or gunzip("/home/file.gz") of the R.utils package. For (2), as already mentioned, R does a good job of reading gzip'ed files "as is". It may e

Re: [R] MApply and SubStr

2015-02-10 Thread David Winsemius
On Feb 10, 2015, at 3:58 PM, Brian Trautman wrote: > Hi! > > I'm trying to write a custom function that applies SubStr to a string, and > then depending on the arguments, converts the output to a number. > > The substring part of my code works fine, but it's not converting the way I > want to -

Re: [R] Ranjan Maitra's comment "Re: Variance is different in R vs. Excel?

2015-02-10 Thread Ronald Wyllys
FWIW, both Excel 2007 and LibreOffice 4.2 yield the correct variance for the numbers in Ranjan Maitra's HW problem for incoming students in R. Namely, both these programs yield a sample variance of 0.28 (rounded to 10 decimal digits). Ronald Wyllys On 02/10/2015 05:00 AM, r-help-req

[R] MApply and SubStr

2015-02-10 Thread Brian Trautman
Hi! I'm trying to write a custom function that applies SubStr to a string, and then depending on the arguments, converts the output to a number. The substring part of my code works fine, but it's not converting the way I want to -- options('stringsAsFactors'=FALSE) require(data.table) substr_ty

Re: [R] library(Rcmdr) sh: otool: command not found

2015-02-10 Thread Nordlund, Dan (DSHS/RDA)
Try setting dependencies = TRUE in install.packages() install.packages("Rcmdr", dependencies = TRUE) hope this is helpful, Dan Daniel J. Nordlund, PhD Research and Data Analysis Division Services & Enterprise Support Administration Washington State Department of Social and Health Services >

[R] library(Rcmdr) sh: otool: command not found

2015-02-10 Thread varin sacha
Hi R experts, I have just updated R and RStudio. I am running OS X 10.6.8 R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin10.8.0 (64-bit) RStudio Version 0.98.1102 – © 2009-2014 RStudio, Inc. Mozilla/5.0

Re: [R] Breaking y- axis using gap.barplot

2015-02-10 Thread Jim Lemon
Hi reviverma, I think your problem is that you have chosen the wrong gap, as it cuts out all of the small bars. Try this: gap.barplot(hdata$counts, gap=c(120,15900), xlab="RMSD", ytics=c(0,100,16000,16100,16200,16300),ylab="Frequency", xtics=hdata$breaks) Note that you have one more "breaks" th

Re: [R] How to unzip a .gz file

2015-02-10 Thread Benno Pütz
readLines (as well as other I/O routines) handles gzip files transparently, you should be able to simply use readLines('/home/file.gz’) Benno On 10 Feb 2015, at 22:45 , Alexandra Catena wrote: > Hello, > > Can someone help me with unzipping a .gz file. I used: > > readLines(gzfile

Re: [R] How to unzip a .gz file

2015-02-10 Thread Clint Bowman
Alexandra, Although you may not have control over the installation of R, 2.15.1 is very old and should be upgraded--the current is 3.1.2 Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology

[R] How to unzip a .gz file

2015-02-10 Thread Alexandra Catena
Hello, Can someone help me with unzipping a .gz file. I used: readLines(gzfile('/home/file.gz')) I also found that I could use gunzip, but after trying to install it, it says: "package ‘gunzip’ is not available (for R version 2.15.1)" Thanks, Alexandra [[alternative HTML version d

Re: [R] How to clean up missing values in a list of lists

2015-02-10 Thread Aron Lindberg
Thanks Dennis! In the end try worked: get_files <- function(pull_lists){   try(sapply(pull_lists$content, "[[", "filename" )) } Best, Aron --  Aron Lindberg Doctoral Candidate, Information Systems Weatherhead School of Management  Case Western Reserve University aronlind

Re: [R] Error: OutOfMemoryError (Java): GC overhead limit exceeded

2015-02-10 Thread jim holtman
Another to try is the 'openxlsx' package if you have '.xlsx' files; it does not read '.xls' files. It seems to be faster than XLConnect and does not require Java; it uses Rcpp to access the APIs. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you wa

Re: [R] function that calculates using preceding records

2015-02-10 Thread Seth Bigelow
Aha, this solution is even more elegant than that of the previous suggestion. Thanks for alerting me to the capabilities of plyr! --Seth -Original Message- From: Dennis Murphy [mailto:djmu...@gmail.com] Sent: Tuesday, February 10, 2015 2:14 PM To: Seth Bigelow Subject: Re: [R] function

Re: [R] oracle connection through proxy authentication

2015-02-10 Thread Prof Brian Ripley
On 10/02/2015 17:41, LaurentB wrote: Hi, Due to a new company policy, I need to connect to an oracle database throw a proxy authentication (http://docs.oracle.com/cd/B19306_01/java.102/b14355/proxya.htm#JJDBC2) but I can't find the solution. Until now, I used the RODBC package but it seems

Re: [R] Problems with tm package, Removeword and trasformations

2015-02-10 Thread Amos B. Elberg
Trying to use t m to analyze tweets, you're going to experience a long stream of issues like the one you found, which generally relate to text formatting. I worked through them over the past few months for a project. If you email me offline I'll try to help and share some example code. > On Fe

Re: [R] Error: OutOfMemoryError (Java): GC overhead limit exceeded

2015-02-10 Thread Allen Bingham
Rebecca, An additional issue might be plots, pivot tables, etc. that you might have in separate sheets on the input Excel workbook (if you have those, just make a separate workbook with only the data you need for R in it). BTW---I've recently been using the following option for similar use of

[R] oracle connection through proxy authentication

2015-02-10 Thread LaurentB
Hi, Due to a new company policy, I need to connect to an oracle database throw a proxy authentication (http://docs.oracle.com/cd/B19306_01/java.102/b14355/proxya.htm#JJDBC2) but I can't find the solution. Until now, I used the RODBC package but it seems that this one do not deal with proxy a

Re: [R] Superscript in legend without using expression function

2015-02-10 Thread jgui001
Cheers Guys it worked! -- View this message in context: http://r.789695.n4.nabble.com/Superscript-in-legend-without-using-expression-function-tp4702929p4703036.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

Re: [R] function that calculates using preceding records

2015-02-10 Thread Seth Bigelow
Petr, Your code works therefore I pronounce it beautiful. Many many thanks --Seth -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: Tuesday, February 10, 2015 11:23 AM To: Seth Bigelow; r-help@r-project.org Subject: RE: [R] function that calculates using prec

Re: [R] SAS equivalent for R's signif function?

2015-02-10 Thread Allen Bingham
Daniel, Thanks for the link and the advice (vis-à-vis SAS-L ... after 30+ years of using SAS I should have remembered that one which I used extensively when learning SAS). FYI-I'm working on some R code that may eventually need to be ported to SAS --- and hence the reason for my question --- I do

Re: [R] function that calculates using preceding records

2015-02-10 Thread PIKAL Petr
Hi I found an extremely ugly code :-) # first reverse levels of treecode to correspond with order of values in data frame temp$treecode<-factor(temp$treecode, rev(levels(temp$treecode))) # add zeroes and values to rw and d temp$rw[is.na(temp$rw)]<-0 library(zoo) temp$d<-na.locf(temp$d) # spl

Re: [R] Coordinate or top left corner + offset

2015-02-10 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 15-02-10 08:55 AM, David L Carlson wrote: > Thanks, I didn't know about corner.label. I started with legend but > I couldn't find a way to make the box small enough. It always > covered much more of the corner than the letter which could have > obsc

[R] How to clean up missing values in a list of lists

2015-02-10 Thread Aron Lindberg
Hi, I’m trying to query the Github API, and I’m running into some data munging issues, so I was hoping someone on the list might advise. Here’s my code. To run it you need to replace client_id and client_secret with your own authorization information for Github. library(github) library(RCur

[R] Problems with tm package, Removeword and trasformations

2015-02-10 Thread Renato Medei
Dear all, I'm sorry but as all the newbies I have a lot of problems to solve. I'm using R 3.1.2 under osx 10.10.2. I'm working with tm to analyze some tweets and I received some strange errors when I tried to remove stopwords (See below error 1), to transform content (See below error 2) and to c

[R] function that calculates using preceding records

2015-02-10 Thread Seth Bigelow
Greetings: My dataframe has 4 variables: treecode, year, rw (tree ring width), and d (tree diameter). The d variable only has data for 2014. I wish to calculate earlier diameters by subtracting each year's growth (rw) from the previous year's diameter, by treecode. Can anyone help me with a

Re: [R] How to solve this complex equation

2015-02-10 Thread Ssuhanchen
Got it! Thanks! I find a useful function, uniroot.all, in package "rootSolve". I hope it will also be helpful to everybody. -- View this message in context: http://r.789695.n4.nabble.com/How-to-solve-this-complex-equation-tp4702997p4703015.html Sent from the R help mailing list archive at Nabbl

Re: [R] Terminating a program using R

2015-02-10 Thread Prof Brian Ripley
On 10/02/2015 07:55, Ssuhanchen wrote: Hi I would like to query that if it is possible for R to terminate a program such as notepad, word, etc.? If yes, what kind of function should I use? The POSIX way to do this is to use 'kill', so try ??kill in your R process or use system() to call your

[R] confint.merMod(method="boot") {lme4} with user supplied FUN to bootMer fails

2015-02-10 Thread Torbjørn Håkan Ergon
Dear list, I'm trying to supply a summary function to confint.merMod(method="boot") {lme4} but get persistent errors. The following example generates the errors: > fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy) > test = function(fit) fixef(fit)[1] > test(fm1) (Intercept) 251.405

Re: [R] How to solve this complex equation

2015-02-10 Thread Doran, Harold
?uniroot -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ssuhanchen Sent: Tuesday, February 10, 2015 3:32 AM To: r-help@r-project.org Subject: Re: [R] How to solve this complex equation no, it is not my homework. I would like to know if there is relevant

Re: [R] transpose a data frame according to a specific variable

2015-02-10 Thread jeff6868
Both ways are doing well the job. Nice! Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/transpose-a-data-frame-according-to-a-specific-variable-tp4702971p4703007.html Sent from the R help mailing list archive at Nabble.com. _

[R] Terminating a program using R

2015-02-10 Thread Ssuhanchen
Hi I would like to query that if it is possible for R to terminate a program such as notepad, word, etc.? If yes, what kind of function should I use? Thank you very much. -- View this message in context: http://r.789695.n4.nabble.com/Terminating-a-program-using-R-tp4703004.html Sent from th

[R] Breaking y- axis using gap.barplot

2015-02-10 Thread riviverma
Hello all I am trying to plot histogram with break in y-axis for my data by following various posts on R- help but none seems solving my problem. My data looks like: > hdata $breaks [1] 0 5 10 15 20 25 30 35 40 45 50 $counts [1] 16311 10824 8 1 3 0 1 6 3 on

Re: [R] How to solve this complex equation

2015-02-10 Thread Ssuhanchen
no, it is not my homework. I would like to know if there is relevant function to solve this equation in R? Could you please give me a hint or suggestion please. Thanks! -- View this message in context: http://r.789695.n4.nabble.com/How-to-solve-this-complex-equation-tp4702997p4703006.html Sent

Re: [R] Coordinate or top left corner + offset

2015-02-10 Thread David L Carlson
Thanks, I didn't know about corner.label. I started with legend but I couldn't find a way to make the box small enough. It always covered much more of the corner than the letter which could have obscured data points. David -Original Message- From: R-help [mailto:r-help-boun...@r-project

[R] How to F noncentrality parameter

2015-02-10 Thread Juan Andres Hernandez
Does anybody know how to calculate noncentrality parameter for a three way interaction? It is easy for a two way interaction, but I can't find the way to do it with a three way. I have been looking for a packages about this, but it seems that none manages to do this. Thank's in advance Juan Hernan

Re: [R] Cube of Matrices or list of Matrices

2015-02-10 Thread Karim Mezhoud
Thanks Ben, Jeff and Roy, Here is an example of my data Disease <- NULL Diseases <- NULL ListMatByGene <- NULL for(i in 1:3){ Disease[[i]] <-matrix(sample(-30:30,25+(5*i)),5+i) rownames(Disease[[i]]) <- paste0("Sample",1:(5+i)) colnames(Disease[[i]]) <- paste0("Gene",1:5) D <- paste0("Disease",i

Re: [R] pairwise.t.test

2015-02-10 Thread Thomas Chesney
Thank you! From: peter dalgaard [pda...@gmail.com] Sent: Tuesday, February 10, 2015 12:05 PM To: Thomas Chesney Cc: r-help@r-project.org Subject: Re: [R] pairwise.t.test On 10 Feb 2015, at 11:45 , Thomas Chesney wrote: > I'm using pairwise.t.test() with

Re: [R] pairwise.t.test

2015-02-10 Thread peter dalgaard
On 10 Feb 2015, at 11:45 , Thomas Chesney wrote: > I'm using pairwise.t.test() with 6 groups, but the dataset the 6 groups are > in actually contains 24 groups. > > When I run the test with all 24 groups the results I'm getting between Group > 1 and Group 2 are very different from the result

Re: [R] Help

2015-02-10 Thread Jeff Newmiller
If it works interactively then as far as this mailing list is concerned it works. Executing in different environments such as a scheduler can affect any program, not just R, and the reasons are due to the operating system, not R. In general, you should be aware of the configuration and resource

[R] pairwise.t.test

2015-02-10 Thread Thomas Chesney
I'm using pairwise.t.test() with 6 groups, but the dataset the 6 groups are in actually contains 24 groups. When I run the test with all 24 groups the results I'm getting between Group 1 and Group 2 are very different from the results I'm getting between Group 1 and Group 2 when I split off the

Re: [R] How to solve this complex equation

2015-02-10 Thread S Ellison
> -Original Message- > I want to use R to calculate the variable x which is in a complex equation in > below: > > 2 > Σ[exp(-x/2)*(x^k)/(2^k*k!)]=0.05 > k=0 > > how to solve this equation to get the exact x in R? For a _numerical_ solution, if f(x) is your function, use uniroot to fi

Re: [R] How to solve this complex equation

2015-02-10 Thread Rolf Turner
On 10/02/15 14:04, Ssuhanchen wrote: Hi! I want to use R to calculate the variable x which is in a complex equation in below: 2 Σ[exp(-x/2)*(x^k)/(2^k*k!)]=0.05 k=0 how to solve this equation to get the exact x in R? Is this homework? Sure looks like it. Talk to your prof. Or do a bit