Re: [R] Writing to a file

2012-02-07 Thread Petr PIKAL
Hi now you omitted data, but never mind :-) > My loop is the following > counter = 0 > for (i in 1:nrow(y)) > { > > > for (j in 1:ncol(y)) > { > if (y[i,j]=="Func_0005634") { > counter = counter + 1 } > if(y[i,j]=="Func_0005737"){ > counter = counter + 1 } > if(y[i,j]

Re: [R] which R package is used for browsing web pages through coding

2012-02-07 Thread R. Michael Weylandt
Perhaps RCurl (or XML depending on how the data is stored): take a look at the omegahat website Michael On Wed, Feb 8, 2012 at 1:17 AM, sagarnikam123 wrote: > Perl has Mechanize module which browse web pages through > programming(coding),creates queries & retrives data through it > > which R pac

Re: [R] Discrimination and calibration of Cox model

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 11:07 PM, cmh wrote: I have been working on fitting Cox model for prediction by using rms package. I want to measure model's calibartion and discrimination. Discrimination was measured by using validate() in rms, Dxy can be transferred to Harrell's c index. But in this w

Re: [R] How to have columns lined up?

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 11:07 PM, hithit168 wrote: Hi there, Everytime when I paste My R output in WORD, the columns couldn't line up nicely like they appear in R console. Is there a way to fix this problem? Thanks for any help! Select the table, make it Courier. But the isn't really an R

[R] Fitting polynomial (power greater than 2)

2012-02-07 Thread dkendall44
Hey all, first time poster here. I'm new to R and working on my first real programming and forecasting asignment. I'm using unemployment data from 1948-2012. I successfully completed part a and the linear fit for part b, but i am really struggling fitting a polynomial with a power greater than 2 t

[R] which R package is used for browsing web pages through coding

2012-02-07 Thread sagarnikam123
Perl has Mechanize module which browse web pages through programming(coding),creates queries & retrives data through it which R package support web browsing through programming -- View this message in context: http://r.789695.n4.nabble.com/which-R-package-is-used-for-browsing-web-pages-through-

[R] Discrimination and calibration of Cox model

2012-02-07 Thread cmh
I have been working on fitting Cox model for prediction by using rms package. I want to measure model's calibartion and discrimination. Discrimination was measured by using validate() in rms, Dxy can be transferred to Harrell's c index. But in this way, I cannot get 95%CI of c index. How can I do t

[R] MCMCglmm

2012-02-07 Thread Safari, Alex (Worldfish)
Dear Jarrod, I have a data set where residual have a heavy-tailed distribution with some extreme residual values and consequently the distribution deviates from the Gaussian one. Is it possible to include an skewed-normal density for the residual in MCMCglmm package? I have done the analysis

[R] How to have columns lined up?

2012-02-07 Thread hithit168
Hi there, Everytime when I paste My R output in WORD, the columns couldn't line up nicely like they appear in R console. Is there a way to fix this problem? Thanks for any help! time n.risk n.event survival std.err lower 95% CI upper 95% CI 6 21 30.857 0.07640.707

[R] path enumeration in a graph

2012-02-07 Thread David Stevens
I'm dipping my toe in graph theory and found that R has a rich collection of network and graph tools. However, I can't seem to put my finger on the solution to my problem. There are several procedures available in R for finding a shortest path along edges between vertices based on the cost of t

Re: [R] Setting up infile for R CMD BATCH

2012-02-07 Thread ilai
On Tue, Feb 7, 2012 at 10:50 PM, ilai wrote: > Ahh, > I think I'm getting it now. Well, readlines() is not going to work for > you. The help file ?readline clearly states "In non-interactive use > the result is as if the response was RETURN and the value is ‘""’." > The implication is you cannot u

Re: [R] data management question

2012-02-07 Thread David Winsemius
On Feb 8, 2012, at 12:23 AM, Sebastián Daza wrote: Hi everyone, I would like to have a function to compute some values in a dataset. First, I have to define a value for the lx variable in row 1 (e.g., 100,000), npx is a given proportion. lx of row 2 is equal to lx of row 1 times npx of row 1. I

Re: [R] data management question

2012-02-07 Thread Berend Hasselman
On 08-02-2012, at 06:23, Sebastián Daza wrote: > Hi everyone, > I would like to have a function to compute some values in a dataset. > First, I have to define a value for the lx variable in row 1 (e.g., > 100,000), npx is a given proportion. lx of row 2 is equal to lx of row > 1 times npx of row

Re: [R] need help with understanding coxph encoding

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 9:11 PM, summer wrote: Hi, in coxph, coxph(Surv(time, status)~x,data=alm). How to encode x? For example, if x has two groups, the treatment group and control group. if I encode them as 1 and 2. Is the HR results treatment/control? What if I encode them as 0 and 1. I am co

[R] data management question

2012-02-07 Thread Sebastián Daza
Hi everyone, I would like to have a function to compute some values in a dataset. First, I have to define a value for the lx variable in row 1 (e.g., 100,000), npx is a given proportion. lx of row 2 is equal to lx of row 1 times npx of row 1. I can do this row by row... data[1,"lx"] <- 10 dat

Re: [R] R equivalent of Python str()?

2012-02-07 Thread William Dunlap
Use capture.output(print(yourData)) to capture would be printed by print as a vector of a strings (one per line of printout). Paste together if desired. Use deparse(yourData) to get a string representation that can be parsed by R (useful for sending to others who are using R). Bill Dunlap Spo

[R] need help with understanding coxph encoding

2012-02-07 Thread summer
Hi, in coxph, coxph(Surv(time, status)~x,data=alm). How to encode x? For example, if x has two groups, the treatment group and control group. if I encode them as 1 and 2. Is the HR results treatment/control? What if I encode them as 0 and 1. I am confused with how survival package works for HR. W

Re: [R] Table rearranging

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 8:43 PM, Jeffrey Joh wrote: Hi David, I am not sure how ddply/summarize solves my issue. I have the following table: ID measurement date door color 1 0.93529385 513 open red 2 0.97419293 420 open red 3 0.962053514 513 closed red 4 0.963909937 1230 open blue 5 0.97652034

Re: [R] Setting up infile for R CMD BATCH

2012-02-07 Thread Gang Chen
Thanks for the help. > You're not missing anything. > In your output.Rout: the ">1" right after the source('test') is the > "1" inputed from answers.R. the "[1] 1" is the result of test. Remove > the second line from answers.R and see what happens (hint: script ends > after the readline prompt).

Re: [R] Table rearranging

2012-02-07 Thread Jeffrey Joh
Hi David, I am not sure how ddply/summarize solves my issue.  I have the following table: ID measurement date door color 1 0.93529385 513 open red 2 0.97419293 420 open red 3 0.962053514 513 closed red 4 0.963909937 1230 open blue 5 0.97652034 1230 open green 6 0.989310795 1230 closed blue 7 0.9

Re: [R] units for mapproject() function result

2012-02-07 Thread Ray Brownrigg
On Wed, 08 Feb 2012, William Stockhausen wrote: > Does anyone know what the units are for projected coordinates obtained > using mapproj's mapproject function with an Albers projection? Thanks for > any and all help! > > Buck Stockhausen I don't know for sure, but it looks like radians to me, w

Re: [R] How to figure out the number of data values in a list?

2012-02-07 Thread R. Michael Weylandt
Also, this is the 3rd post in the last ~36 hours asking elementary questions about that data set and my homework senses are tingling. Perhaps a moratorium on them? M On Feb 7, 2012, at 6:09 PM, "Nordlund, Dan (DSHS/RDA)" wrote: > >> -Original Message- >> From: r-help-boun...@r-proje

Re: [R] R equivalent of Python str()?

2012-02-07 Thread R. Michael Weylandt
Possibly as.character() is what the OP was seeking Michael On Feb 7, 2012, at 7:15 PM, jim holtman wrote: > ?dump > ?dput > > 2012/2/7 Ernest Adrogué : >> Hi, >> >> I was wondering if there's a function in R that is meant to return a >> string representation of an object. Basically, it's like

Re: [R] "Zoomable" time series plots

2012-02-07 Thread Gabor Grothendieck
On Tue, Feb 7, 2012 at 8:02 PM, Hasan Diwan wrote: > Not sure if the question is appropos, but I have multiple csv's which > are read into an xts object, corresponding to telemetry data > (accelerometer, magnetometer/compass, and gyroscope). For examination, > it would be über useful if plot.zoo (

[R] "Zoomable" time series plots

2012-02-07 Thread Hasan Diwan
Not sure if the question is appropos, but I have multiple csv's which are read into an xts object, corresponding to telemetry data (accelerometer, magnetometer/compass, and gyroscope). For examination, it would be über useful if plot.zoo (or something similar) allowed me to zoom in and out of a sub

Re: [R] R equivalent of Python str()?

2012-02-07 Thread jim holtman
?dump ?dput 2012/2/7 Ernest Adrogué : > Hi, > > I was wondering if there's a function in R that is meant to return a > string representation of an object. Basically, it's like print() but > it doesn't print anything, it only returns a string. > > I know there's a str() function but it's not quite

[R] R equivalent of Python str()?

2012-02-07 Thread Ernest Adrogué
Hi, I was wondering if there's a function in R that is meant to return a string representation of an object. Basically, it's like print() but it doesn't print anything, it only returns a string. I know there's a str() function but it's not quite the same. I mean a function that returns the same s

[R] units for mapproject() function result

2012-02-07 Thread William Stockhausen
Does anyone know what the units are for projected coordinates obtained using mapproj's mapproject function with an Albers projection? Thanks for any and all help! Buck Stockhausen *** * Dr. William T. Stockhausen *

Re: [R] Setting up infile for R CMD BATCH

2012-02-07 Thread ilai
You're not missing anything. In your output.Rout: the ">1" right after the source('test') is the "1" inputed from answers.R. the "[1] 1" is the result of test. Remove the second line from answers.R and see what happens (hint: script ends after the readline prompt). Just out of curiosity, why will y

Re: [R] How to figure out the number of data values in a list?

2012-02-07 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Ajata Paul > Sent: Tuesday, February 07, 2012 2:49 PM > To: r-help@r-project.org > Subject: [R] How to figure out the number of data values in a list? > > Hello, > > I am worki

[R] Setting up infile for R CMD BATCH

2012-02-07 Thread Gang Chen
Suppose I create an R program called myTest.R with only one line like the following: type <- as.integer(readline("input type (1: type1; 2: type2)? ")) Then I'd like to run myTest.R in batch mode by constructing an input file called answers.R with the following: source("myTest.R") 1 When I ran t

[R] How to figure out the number of data values in a list?

2012-02-07 Thread Ajata Paul
Hello, I am working with the following data: nb10 <- read.table("http://www.adjoint-functors.net/su/web/314/R/NB10";) I need to figure out how many data values are in this list. -- View this message in context: http://r.789695.n4.nabble.com/How-to-figure-out-the-number-of-data-values-in-a

[R] rJava load failure, 64-bit R, 64-bit Java, R 2.14.1 (works fine on R 2.12.2 64-bit, same computer)

2012-02-07 Thread Strunk, Jacob
Hello R users, I have encountered difficulty in attempting to load the package "rJava" for 64-bit R 2.14.1. It appears that the problem is specific (for my system) to this version of R. I had no trouble loading rJava on an earlier version (2.12.2) of R. N:\>java -version java version "1.6.0_25

Re: [R] Help need

2012-02-07 Thread Andrew Miles
You need to store the values of each iteration in a vector, and then display the vector after you the loop terminates. I made a few updates to your code, and it seems to do what you want now. And thanks for including the code. That made is easy to know how to help. spectrum = c() for(f in seq

Re: [R] ggplot2(0.9.0): could not find function "=="

2012-02-07 Thread Hadley Wickham
> I'm curious if you have a guess whether the issue I was having is a > result of the "problems" with the 0.9.0 version or if they're due to > fundamental changes in ggplot2? It looks like a bug - I'll add it to the to do list. Hadley -- Assistant Professor / Dobelman Family Junior Chair Depart

Re: [R] Vectorizing a loop

2012-02-07 Thread Jeff Newmiller
On Tue, 7 Feb 2012, David Winsemius wrote: On Feb 7, 2012, at 12:56 PM, Jeff Newmiller wrote: On Tue, 7 Feb 2012, Alexander Shenkin wrote: Hello Folks, I'm trying to vectorize a loop that processes rows of a dataframe. It involves lots of conditionals, such as "If column 10 == 3, and if c

Re: [R] Help need

2012-02-07 Thread Justin Haynes
Instead of a for loop, why not use the vectorization inherent in R? sigmasqaured <- 1 i <- complex(real = 0, imaginary =1) f <- seq(0,0.5,0.1) spectrum <- (sigmasqaured)/(abs(1-2.7607*exp(2*pi*i*f)+3.8106*exp(4*pi*i*f)-2.6535*exp(6*pi*i*f)+0.9258*exp(8*pi*i*f))^2) > spectrum [1] 9.632720e+00 1.4

Re: [R] fixed effects linear model in R

2012-02-07 Thread Andrew Miles
Based on Paul Allison's booklet "Fixed Effect Regression Models" (2009), the FE model can be estimated by person-mean centering all of your variables (but not the outcome), and then including a random intercept for each person. The centering gives you the FE model estimates, and the random inte

[R] Help need

2012-02-07 Thread Jaymin Shah
I have mad a for loop to try and output values which i have named spectrum. However, I cannot seem to get the answers to come out as a vector which is what i need. They come out as separate values which I am then unable to join together. Thank you for(f in seq(0,0.5,0.1)) { sigmasqaure

[R] fixed effects linear model in R

2012-02-07 Thread cariboupad
Dear R-helpers, First of all, sorry for those who have (eventually) already received that request. The mail has been bumped several times, so I am not sure the list has received it... and I need help (if you have time)! ;-) I have a very simple question and I really hope that someone could help

Re: [R] binomial vs quasibinomial

2012-02-07 Thread ilai
Not really an R question, now is it ? more like pure stats. I'm guessing you didn't get an answer because this list can't tell you how to analyze your data (or in your case, approve an incorrect analysis). Regarding the part of your question that is R related, I think you may be confused on what t

[R] gmodels error: "no method for coercing this S4 class to a vector"

2012-02-07 Thread Timothy J Clough
Dear All, I'm having a problem using functions in the gmodels library on an object of class mer from the lmer package. Code for a reproducible example is below. # Load lme4 library and sample data library(lme4) library(faraway) library(gmodels) data(penicillin) # Fit a linear mixed effect

[R] truncated regression

2012-02-07 Thread Gilda Mazzarelli
Hi all, I'm having problems with the command treg (truncated regression) in FEAR 1.15. In the manual, there is a simple explication of the argument that have to be put in the commandbut in the examples there are more passages, like the product between matrix and the command rnorm.trunc: I don'

Re: [R] Positioning text in top left corner of plot

2012-02-07 Thread 538280
You might want to look at the grconvertX and grconvertY functions. You can use them to convert a coordinate relative to the plotting device (screen, paper) or plotting region to user coordinates to use with text or mtext. On Tue, Feb 7, 2012 at 4:06 AM, Manta wrote: > Dear all, > > another questi

[R] survfit is too slow! Looking for an alternative

2012-02-07 Thread Ying Zhou
Hi All I found survfit function was very slow for a large dataset and I am looking for an alternative way to quickly get the predicted survival probabilities. My historical data set is a pool of loans with monthly observed default status for 24 months. I would like to fit the proportional h

Re: [R] lme, lmer, convergence

2012-02-07 Thread Ben Bolker
Erin McMullen Jonaitis wisc.edu> writes: > Hello, all, I am running some simulations to estimate power for a > complicated epidemiological study, and am using lme and lmer to get > these estimates. I have to run a few thousand iterations, and once > in a great while, an iteration will create fa

Re: [R] replace elements of a data frame

2012-02-07 Thread Berend Hasselman
On 07-02-2012, at 20:24, Arnaud Gaboury wrote: > I did indeed have a look at recode(), and was able to replace, but an error > warning : > >> recode(names,"BO","BOO",df) > Warning message: > In recode.default(names, "BO", "BOO", df) : > Name(s) of vars duplicates with an object outside the dat

[R] lme, lmer, convergence

2012-02-07 Thread Erin McMullen Jonaitis
Hello, all, I am running some simulations to estimate power for a complicated epidemiological study, and am using lme and lmer to get these estimates. I have to run a few thousand iterations, and once in a great while, an iteration will create fake data such that the model won't converge. I s

Re: [R] Need to Write a Code that can find the molecular weight of various compounds

2012-02-07 Thread matthew.ttd.nguyen
Thanks Paul, I was trying to get the function for getMass to input into another column into a data set using R code: FakeCompounds$Molecule <- with(FakeCompounds, getMolecule(Molecular.Formula)) showData(FakeCompounds, placement='-20+200', font=getRcmdr('logFont'), maxwidth=80, maxheight=3

Re: [R] replace elements of a data frame

2012-02-07 Thread Arnaud Gaboury
I used in fact recode() from epilcac package, not the one you mentioned! Arnaud Gaboury   A2CT2 Ltd. -Original Message- From: Arnaud Gaboury Sent: mardi 7 février 2012 20:25 To: Jorge I Velez Cc: r-help@r-project.org; Arnaud Gaboury Subject: RE: [R] replace elements of a data frame I d

Re: [R] replace elements of a data frame

2012-02-07 Thread Arnaud Gaboury
I did indeed have a look at recode(), and was able to replace, but an error warning : > recode(names,"BO","BOO",df) Warning message: In recode.default(names, "BO", "BOO", df) : Name(s) of vars duplicates with an object outside the dataFrame. > df names price 1 BOO10 2 C25 3

Re: [R] .Random.seed not found

2012-02-07 Thread Peter Langfelder
You need to use set.seed() or one of the random number generators to have .Random.seed defined. Also, if you load a previously saved workspace and that workspace had a .Random.seed defined, you will have it defined. HTH Peter On Tue, Feb 7, 2012 at 9:58 AM, Wilkerson, Sylvia (NIH/CIT) [E] wrote

Re: [R] replace elements of a data frame

2012-02-07 Thread Jorge I Velez
Hi Arnaud, Take a look at require(car) ?recode HTH, Jorge.- On Tue, Feb 7, 2012 at 1:05 PM, Arnaud Gaboury <> wrote: > Hello, > > I am getting mad at finding a simple way to replace elements of a df. > > Here is a short df : > > > names<-c("BO","C","CL") > > price<-c("10","25","20") > > df<-d

[R] 3D confidence ellipsoid with ellipse projections onto 2D plane

2012-02-07 Thread Samuel Bazzi
I have a 3xN matrix of parameters obtained from N regressions where the 3 parameters are jointly statistically significant. I would like to reproduce a 3D confidence ellipsoid projecting 2D ellipses onto the XY plane as in Figure 5.2 in this text

[R] replace elements of a data frame

2012-02-07 Thread Arnaud Gaboury
Hello, I am getting mad at finding a simple way to replace elements of a df. Here is a short df : > names<-c("BO","C","CL") > price<-c("10","25","20") > df<-data.frame(names,price) I want to replace "BO" by "BOB", "C" by "CR", "CL" by "CLO", and the list is more long. I can do that for each

[R] .Random.seed not found

2012-02-07 Thread Wilkerson, Sylvia (NIH/CIT) [E]
Hi All, I have a user who is receiving this error after running the following: library(rjags) library(R2jags) x = c(1.6907, 1.7242, 1.7552, 1.7842, 1.8113, 1.8369, 1.8610, 1.8839) n = c(59, 60, 62, 56, 63, 59, 62, 60) r = c(6, 13, 18, 28, 52, 53, 61, 60) N = 8 data=list("x","n","r","N") inits=fun

Re: [R] UTF8

2012-02-07 Thread Norma
Hi, I just found the solution to the problem in the following posts: https://stat.ethz.ch/pipermail/r-sig-mac/2008-October/005395.html AND https://stat.ethz.ch/pipermail/r-sig-mac/2010-February/007106.html Now everything works. cheers Norma -- View this message in context: http://r.78

Re: [R] Best way to remove all objects but leave the functions in a workspace.

2012-02-07 Thread Barry Rowlingson
Best? Probably not. No money back if this deletes everything by mistake: remove(list=ls()[sapply(ls(),function(n){!is.function(get(n))})]) As a function, maybe: clearNonF=function(e=.GlobalEnv){remove(list=ls(e)[sapply(ls(e),function(n){!is.function(get(n))})],envir=e)} clearNonF() will clear o

Re: [R] predict.naiveBayes() bug in e1071 package

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 12:43 PM, Ali Tofigh wrote: Hi, I'm currently using the R package e1071 to train naive bayes classifiers and came across a bug: When the posterior probabilities of all classes are small, the result from the predict.naiveBayes function become NaNs. This should be sent to th

Re: [R] Vectorizing a loop

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 12:56 PM, Jeff Newmiller wrote: On Tue, 7 Feb 2012, Alexander Shenkin wrote: Hello Folks, I'm trying to vectorize a loop that processes rows of a dataframe. It involves lots of conditionals, such as "If column 10 == 3, and if column 3 is True, and both column 5 and 6

Re: [R] Vectorizing a loop

2012-02-07 Thread Petr Savicky
On Tue, Feb 07, 2012 at 11:39:42AM -0500, Alexander Shenkin wrote: > Hello Folks, > > I'm trying to vectorize a loop that processes rows of a dataframe. It > involves lots of conditionals, such as "If column 10 == 3, and if column > 3 is True, and both column 5 and 6 are False, then set column 4

Re: [R] Vectorizing a loop

2012-02-07 Thread Jeff Newmiller
On Tue, 7 Feb 2012, Alexander Shenkin wrote: Hello Folks, I'm trying to vectorize a loop that processes rows of a dataframe. It involves lots of conditionals, such as "If column 10 == 3, and if column 3 is True, and both column 5 and 6 are False, then set column 4 to True". So, for example, a

[R] predict.naiveBayes() bug in e1071 package

2012-02-07 Thread Ali Tofigh
Hi, I'm currently using the R package e1071 to train naive bayes classifiers and came across a bug: When the posterior probabilities of all classes are small, the result from the predict.naiveBayes function become NaNs. This is an issue with the treatment of the log-transformed probabilities insid

Re: [R] na.action in stats::factanal()

2012-02-07 Thread Timothy Bates
Thanks for the clear explanation Terry! It gets ugly for many factanal applications, where you are dealing with 300 variables… One question: what would be wrong with auto generating the formula from a matrix call? That way the matrix call gets the benefit of returning scores. Also: you say a

Re: [R] lmer with spatial and temporal random factors, not nested

2012-02-07 Thread Ben Bolker
Marte Lilleeng gmail.com> writes: > > Hi, I am new to this list. The r-sig-mixed-mod...@r-project.org mailing list would be more appropriate for this question -- please direct any further questions there ... > I have a question regarding including both spatial and temporal random > factors i

Re: [R] Actual vs. predicted survival times

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 10:32 AM, Bonnett, Laura wrote: Dear R-help, I am using R 2.14.1 on Windows 7. I would like to produce a plot like the attached - although simplified to actual vs. Predicted survival time with distinguishing marks for censored and observed points. I have a dataset and

[R] Reading a Fixed-Width File with SAS import instructions directly into an R data frame

2012-02-07 Thread Anthony Damico
Hi everyone, I'm wondering if anyone has written (or knows of) an R function that takes the SAS import code to read in an ASCII / fixed-width data file.. and then parses out the SAS code to figure out how to structure a (foreign package) read.fwf command so that fixed-width data file can be read

[R] Vectorizing a loop

2012-02-07 Thread Alexander Shenkin
Hello Folks, I'm trying to vectorize a loop that processes rows of a dataframe. It involves lots of conditionals, such as "If column 10 == 3, and if column 3 is True, and both column 5 and 6 are False, then set column 4 to True". So, for example, any ideas about vectorizing the following? df =

[R] R2WinBUGS error message

2012-02-07 Thread anaraster
Hi! I am new to BUGS and running BUGS from R. I am trying to run a regression model from R, however I have this error message: Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cannot create file 'c:/Program Files/WinBUGS14//Syst

[R] Problem with plotting a square 1 x 3 plot and placement of outer margin text

2012-02-07 Thread Mark Na
Dear R-helpers, Please see the attached plot. The problem is that I have too much space between the x-axis label (which is mtext in an outer margin) and the plots. My par settings for this plot are: >par(mfrow=c(1,3),oma=c(2,2,2,2),mar=c(5.1,4.1,4.1,2.1),pty="s") >#here is the code that produce

Re: [R] Creating time series (ts) object

2012-02-07 Thread Filoche
Thank you for your help. I'll simply remove leap days from my serie. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Creating-time-series-ts-object-tp4362762p4364664.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Writing to a file

2012-02-07 Thread R. Michael Weylandt
As I said to you a while back, use append = TRUE. Michael On Tue, Feb 7, 2012 at 4:18 AM, Felicity wrote: > Thanks a lot for the interest :) > > My loop is the following > counter = 0 >  for (i in 1:nrow(y)) >  { > > >  for (j in 1:ncol(y)) >  { >  if (y[i,j]=="Func_0005634") { >         counter

[R] binomial vs quasibinomial

2012-02-07 Thread Jhope
After looking at 48 glm binomial models I decided to try the quasibinomial with the top model 25 (lowest AIC). To try to account for overdispersion (residual deviance 2679.7/68 d.f.) After doing so the dispersion factor is the same for the quasibinomial and less sectors of the beach were significa

Re: [R] nice report generator?

2012-02-07 Thread Martin Studer
Hi Michael, Hi all, an alternative for reading/writing tables from/to Excel is the package XLConnect. It is platform-independent and therefore runs under Windows, UNIX/Linux & Mac. It supports reading/writing worksheets as well as named ranges. In addition, for reporting purposes, there is support

[R] Actual vs. predicted survival times

2012-02-07 Thread Bonnett, Laura
Dear R-help, I am using R 2.14.1 on Windows 7. I would like to produce a plot like the attached - although simplified to actual vs. Predicted survival time with distinguishing marks for censored and observed points. I have a dataset and have fitted a Cox model to it. In an attempt to visuali

Re: [R] glht (multicomparisons) with a binomial response variable

2012-02-07 Thread gaiarrido
Thanks very much, Frank, I will try, first I have to adjust your solution to my problem cause i have just for months : april, may, june and july. I will tell you!! Thanks again - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola

Re: [R] Writing to a file

2012-02-07 Thread Felicity
Thanks a lot for the interest :) My loop is the following counter = 0 for (i in 1:nrow(y)) { for (j in 1:ncol(y)) { if (y[i,j]=="Func_0005634") { counter = counter + 1 } if(y[i,j]=="Func_0005737"){ counter = counter + 1 } if(y[i,j]=="Func_0005515"){ counter = c

[R] GLM Quasibinomial - 48 models

2012-02-07 Thread Jhope
I've originally made 48 GLM binomial models and compare the AIC values. But dispersion was very large: Example: Residual deviance: 8811.6 on 118 degrees of freedom I was suggested to do a quasibinomial afterwards but found that it did not help the dispersion factor of models and received a warn

[R] fixed effects with clustered standard errors

2012-02-07 Thread cariboupad
Dear R-helpers, I have a very simple question and I really hope that someone could help me I would like to estimate a simple fixed effect regression model with clustered standard errors by individuals. For those using Stata, the counterpart would be xtreg with the "fe" option, or areg with the

Re: [R] using mclapply (multi core apply) to do matrix multiplication

2012-02-07 Thread Alaios
I wouldl ike to thank you for your response. The hardest part in the installation is to find a BLAS library to install. If I understand it right once I install BLAS then I only need to change a flag in the ./configure of R installation.. Our system is running opensuse and has intel cores. accord

[R] Best way to remove all objects but leave the functions in a workspace.

2012-02-07 Thread Keith Weintraub
I think the subject says it all. Thanks in advance, KW -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting

Re: [R] Weighted mad

2012-02-07 Thread Chris Campbell
Dear Stephen The names of methods of aggregate can be viewed with the methods argument. Typing aggregate.data.frame shows you the method used for data frames. > methods(aggregate) [1] aggregate.data.frame aggregate.defaultaggregate.formula* [4] aggregate.ts Non-visible functions are aste

Re: [R] Positioning text in top left corner of plot

2012-02-07 Thread Manta
Thanks, mtext with option 'line' does the trick. I could not see that option in my version of R, but it appeared when I installed it again. -- View this message in context: http://r.789695.n4.nabble.com/Positioning-text-in-top-left-corner-of-plot-tp831723p4365088.html Sent from the R help mailing

Re: [R] Weighted mad

2012-02-07 Thread ONKELINX, Thierry
You could try something like this. library(plyr) ddply(pool, .(ym), function(z){ weighted.mean(x= z$SMM, w = z$wght) }) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assur

Re: [R] using mclapply (multi core apply) to do matrix multiplication

2012-02-07 Thread Spencer Graves
What is the nature of the matrices? Are they sparse or derived from sparse matrices? If they are sparse, have you looked at the packages available in R for sparse matrices? library(sos) summary(sp <- findFn('sparse', 999)) will identify help pages in contri

Re: [R] Lattice - different axis length

2012-02-07 Thread Florian Weiler
Thanks a lot for your help! I found that the relation="free" command was very helpful, but then I had a little space between the axis and where the bars actually begun. I tried to deal with it in a panel function but was unable to do so. However, I found a way providing a list to xlim: barchart(

[R] Weighted mad

2012-02-07 Thread Bond, Stephen
Greetings UseRs, Pls advise if there is a way to write a func that can be supplied to aggregate to compute weighted MeanAbsolute Dev (MAD). I am having trouble passing the correct weights from each group level and cannot see the code behind aggregate. But maybe 'aggregate' is not the best way t

Re: [R] na.action in stats::factanal()

2012-02-07 Thread Terry Therneau
> Does factanal() force the user to use the formula interface if they > wish to specify an na.action? Short answer: yes. Long answer: The handling of na.action is a built in part of the formula processing functions, so it's automatic when dealing with a formula. There are also downstream effects

Re: [R] box.cox

2012-02-07 Thread Tal Galili
I stand corrected - thank you for the clarification John. Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (Engli

Re: [R] Logistic Regression

2012-02-07 Thread Terry Therneau
I'm surprised not to see the simple answer: "glm" models return the MLE estimate. fit <- glm(y ~ x1 + x2 + , family='binomial') There is no need for special packages, this is a standard part of R. Terry Therneau begin included message -- On 02/06/2012 03

Re: [R] Positioning text in top left corner of plot

2012-02-07 Thread Benno Pütz
Both are described in the documentation (?(m)text works for me): Usage mtext(text, side = 3, line = 0, outer = FALSE, at = NA, adj = NA, padj = NA, cex = NA, col = NA, font = NA, ...) Arguments texta character or expression vector specifying the text to be written. Other obj

Re: [R] box.cox

2012-02-07 Thread John Fox
Dear Tal and Rosario, The bcPower() function in the car package computes Box-Cox power transformations; boxcox() in the MASS package estimates the response transformation parameter for the Box-Cox regression model (actually the profile log-likelihood for a range of variables of the parameter). The

Re: [R] Lattice - different axis length

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 6:42 AM, Florian Weiler wrote: Dear all, I have a question about the lattice package, more specifically about the control of the x-axis length in the different panels. I use the following code to make the stacked barchart: barchart(country ~ climatechangefocalpoint + m

Re: [R] Table rearranging

2012-02-07 Thread David Winsemius
On Feb 7, 2012, at 4:21 AM, Jeffrey Joh wrote: Thank you for your help, Bill. From the original table (not the plyr output), I would like to remove all the lines that do not have a corresponding open/closed measurement. For example, if there is a Closed yellow measurement on 0917, but

Re: [R] Lattice - different axis length

2012-02-07 Thread Weidong Gu
Hi, set scales=list(x=list(relation='free')) may help. Weidong Gu On Tue, Feb 7, 2012 at 6:42 AM, Florian Weiler wrote: > Dear all, > > I have a question about the lattice package, more specifically about the > control of the x-axis length in the different panels. I use the following > code to

Re: [R] Positioning text in top left corner of plot

2012-02-07 Thread Manta
Thanks, although I still have a couple of questions: 1. What is the line parameter? I could not find it in the manual... 2. How does exactly work the adj parameter when giving two different values? -- View this message in context: http://r.789695.n4.nabble.com/Positioning-text-in-top-left-corne

Re: [R] xtable "beta" testing wanted

2012-02-07 Thread Ista Zahn
Hi Charles, This looks great, I'll try it out later today. Any chance that more automated multicolumn headers will be added in a future version? I know you can do it using the add.to.row argument, but it would be great to have an automated way using something like cgroup and n.cgroup in Hmisc:

Re: [R] using mclapply (multi core apply) to do matrix multiplication

2012-02-07 Thread Ernest Adrogué
7-02-2012, 03:32 (-0800); Alaios escriu: > I wouldl ike to thank you for your response. The hardest part in the > installation is to find a BLAS library to install. If I understand > it right once I install BLAS then I only need to change a flag in > the ./configure of R installation.. > > > Our

Re: [R] creating more vectors out of one

2012-02-07 Thread Marion Wenty
Thank you very much for your help! I used the split(apkz, cumsum(apkz==1)) command and it worked! I find the command very interesting and after a bit of thinking I found out, why the command cusum is used! (Because TRUE equals 1 and FALSE equals 0) Thanks again! Marion 2012/2/6 Petr PIKAL

Re: [R] Positioning text in top left corner of plot

2012-02-07 Thread Benno Pütz
Regarding example 1: mtext has a line parameter that should help you example 2: using text(par("usr")[1],par("usr")[4],"EUR billions",cex=0.7,adj=c(0,-1.5)) does not depend on the axis (values/range) beyond par('usr') With text(par("usr")[1], … you get something closer to y

  1   2   >