Re: [R] a question about lm on t-test.

2011-08-15 Thread Lao Meng
In my first email,I wrote: summary(lm(extra~group)) Maybe the same as your "summary.lm" 2011/8/16 Jeff Newmiller > ** Sorry, I missed the nature of the data. > > As to your original question, perhaps typing "summary.lm" at the R prompt > can enlighten you? > > ---

Re: [R] How to change axis line color in xyplot function?

2011-08-15 Thread liuzzz6
By searching, i finally found the resolution. We could set "par.settings = list( axis.line = list(col ='white') )" in xyplot function, then the axis border lines will be white. Thanks anyway. Regards, Black -- View this message in context: http://r.789695.n4.nabble.com/How-to-change-axis-line-c

[R] How to change axis line color in xyplot()

2011-08-15 Thread liuzzz6
Hi all, I tried and searched a lot to find a way of changing color of axis line in applying xyplot() function. Take following code as example: library(lattice) par(col='white') par(col.axis='white') par(col.lab='white') z = data.frame(x = 1:5) xyplot(x~x, z) The par(col.axis='white') has no ef

Re: [R] a question about lm on t-test.

2011-08-15 Thread Jeff Newmiller
Sorry, I missed the nature of the data. As to your original question, perhaps typing "summary.lm" at the R prompt can enlighten you? --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.

Re: [R] a question about lm on t-test.

2011-08-15 Thread Lao Meng
The mean of group1 is 0.75,just the same as intercept. Acturally,R treated group1 as reference,so intercept is just group1. 2011/8/16 Jeff Newmiller > Why would you assert that the mean is the same as the intercept? For data > clustered far from the y axis this seems clearly unlikely to be tru

Re: [R] a question about lm on t-test.

2011-08-15 Thread Jeff Newmiller
Why would you assert that the mean is the same as the intercept? For data clustered far from the y axis this seems clearly unlikely to be true. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go...

[R] a question about lm on t-test.

2011-08-15 Thread Lao Meng
Hi all: I have a question about lm on t-test. data(sleep) I wanna perform t-test to test the difference between the 2 groups: I can use: t.test(extra~group) The t.test result shows that:t = -1.8608; mean1=0.75,mean2=2.33 But I still wanna use: summary(lm(extra~group)) Intercept=0.75,which is

Re: [R] Alternative and more efficient data manipulation

2011-08-15 Thread Dennis Murphy
Hi: As previously mentioned, the reshape package (in particular, melt()) is an alternative to make.groups(), although they serve the same purpose in this example: dat <- data.frame(`x1`=runif(6, 0, 125), `x2`=runif(6, 50, 75), `x3`=runif(6, 0, 100),

Re: [R] lattice: How to get log base for each axis inside panel function?

2011-08-15 Thread Deepayan Sarkar
On Mon, Aug 15, 2011 at 10:34 PM, Mikhail Titov wrote: > Hello! > > I'd like to have a function to draw correct grid while using log axis with > xyplot from lattice package. Right now I have the following code inside of my > panel function: > > lim <- current.panel.limits() > v <- latticeExtra::

Re: [R] calibration curve for cph()

2011-08-15 Thread David
A combination of Predict (your newdata), cut2, and the plotting function of your choice ought to suffice. But thought that cross-validation was an option. Not at console at the moment (just off airplane.) Sent from my iPhone On Aug 15, 2011, at 5:26 PM, array chip wrote: > is there a R functi

[R] Combining Venn Diagrams

2011-08-15 Thread Phil Schnarrs
Hi All, Is there anyway to combine vennDiagrams with venneuler commands so I can have both of the diagrams as one? venneuler gives me proportionate circles but without numbers and veenDiagrams gives me numbers without proportionate circles. Thanks, Phil [[alternative HTML version delete

[R] rJava and error messages

2011-08-15 Thread Phil Schnarrs
Hello All, I'm trying to load the rJava package and every time I do I receive this error message: Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(...) error: JAVA_HOME cannot be determined from the Registry Error: package/namespace load failed for 'rJava' Can anyo

Re: [R] Problem loading rJava... (apparently solved)

2011-08-15 Thread Brian Lunergan
On Mon, 2011-08-15 at 10:41 -0500, Joseph Magagnoli wrote: > Brian, > I believe I had a similar problem. Make sure you have JDK (*sun-java6-jdk) > * installed as well. > Here is a link to a JDK install guide > http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/ > Joseph

Re: [R] constraining betas with mlogit package

2011-08-15 Thread Rolf Turner
On 16/08/11 10:58, Bert Gunter wrote: Well, of course that doesn't work for categorical covariates (duhhh!) -- so I'll just stop at my first clause, "I don't know." Sorry. I would suggest that a better specification of the model and the constraints may elicit better and faster responses. I thi

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-15 Thread Monsieur Do
The labels can contain much more than just names. In my case, they are variable descriptions (items from a questionnaire). I need to keep the names as they are, hence the need for Hmisc's labels. On Mon, Aug 15, 2011 at 3:53 PM, Monsieur Do wrote: > I have a dataset and a list of labels. I simp

[R] Font size R

2011-08-15 Thread Filoche
Hi everyone. I'm using this following code: pdf(file="Fig5.pdf", width = 4.86, height = 6.29, pointsize = 10, family ='Times') par(mfcol = c(3,2), mai = c(0.4,0.8,0,0), omi = c(0.7, 0, 0.7, 0.1)); hist( rnorm(100) ) dev.off() When I open this in any vectorial software (like Illustrator), it say

Re: [R] area under the curve

2011-08-15 Thread Rolf Turner
On 16/08/11 05:07, Mariana Varela wrote: HI there, I have been trying to use a code posted on R help to be able to calculate area under the curve for complicated data points and there seems to be an issue with the code: no "b" object found. I am not a good R user and can't find were the problem

Re: [R] Query for semi-transparency support

2011-08-15 Thread baptiste auguie
Here's a warning, but it sounds like it's at a deep (C, presumably) level, xfig() grid::grid.rect(gp=gpar(fill="red", alpha=0.5)) Warning message: In grid.Call.graphics("L_rect", x$x, x$y, x$width, x$height, resolveHJust(x$just, : semi-transparency is not supported on this device: reported only

[R] Query for semi-transparency support

2011-08-15 Thread Jesse Brown
In ?par there is the following line: "Semi-transparent colors are available for use on devices that support them." I'm looking for a way to query for that support on the current device. I'm pretty sure that this functionality exists at some level as I remember seeing warnings to this effect but

Re: [R] what can one do with (to) '..." ?

2011-08-15 Thread Bert Gunter
Sorry about the incomplete post: gMail just vomited on me. Here's the complete post: On Mon, Aug 15, 2011 at 7:40 PM, Bert Gunter wrote: > FWIW: > > 1. The best reference i know is the discussion in Venables's and > Ripley's "S Programming" book > > 2. VERY BRIEF and INADEQUATE discussion. The ge

Re: [R] what can one do with (to) '..." ?

2011-08-15 Thread Bert Gunter
FWIW: 1. The best reference i know is the discussion in Venables's and Ripley's "S Programming" book. 2. VERY BRIEF and INADEQUATE discussion. The general idea is that it allows one to easily pass down "extra" arguments to the internals of a function. For example, suppose that you want to write

Re: [R] what can one do with (to) '..." ?

2011-08-15 Thread Comcast
Inside your function that has a ... argument, you can get the optional arguments with : Arg.dot <- list(...) Section 2.1.5 of the R Language Definition which should be accessible from the help facility would appear to be sensible place to start. "Programming for Data Analysis" could also be pu

Re: [R] Regression - how to deal with past values?

2011-08-15 Thread Comcast
Have you done any searching (with for instance the term "forecast")? If so then you should describe what you found and why it doesn't meet your needs. -- David Sent from my iPhone On Aug 15, 2011, at 7:54 PM, "Eduardo M. A. M.Mendes" wrote: > Many thanks but I am not looking for a remote

Re: [R] Can you send "side effect" text into a variable?

2011-08-15 Thread baptiste auguie
Hi, Try this, ?capture.output as in, capture.output(cat("this is it")) HTH, baptiste PS: Here's another example for fun, # library(textplot) capture.output(txtplot(1:10)) library(gplots) textplot(capture.output(txtplot(1:10))) library(grid) grid.cap() # not sure how to get back to the orig

Re: [R] Regression - how to deal with past values?

2011-08-15 Thread Eduardo M. A. M.Mendes
Many thanks but I am not looking for a remote consulting. Actually it is not difficult but unfortunately I am a newbie as far as writing functions on R. Can I gather from your email that there is nothing available on R that deals with dynamic models (k-step ahead and free-run)? Cheers Ed -

[R] Can you send "side effect" text into a variable?

2011-08-15 Thread andrewH
Dear folks -- There are a number of functions -- I am thinking of str() as an example -- that produce text as a side-effect, rather then returning it. Is there any way to send the text produced by such functions into a character variable? Any suggestions would be greatly appreciated. andrewH

Re: [R] Alternative and more efficient data manipulation

2011-08-15 Thread Mikhail Titov
?reshape You have your data in a wide format, but you want it in a long format. reshape can convert it both ways. Mikhail > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Sam Albers > Sent: Monday, August 15, 2011 6:58 PM > T

[R] Alternative and more efficient data manipulation

2011-08-15 Thread Sam Albers
Hello list, ## I have been doing the following process to convert data from one form to another for a while but it occurs to me that there is probably an easier way to do this. I am often given data that have column names which are actually data and I much prefer dealing with data that are sorted

[R] what can one do with (to) '..." ?

2011-08-15 Thread Carl Witthoft
I followed a couple threads from the archives and from stackoverflow.com, and would like to know: just what is "..." ? What I mean by this is,for example, from the point of view of a user running a function in debug mode, is "..." an object, or does it exist in the current environment as som

Re: [R] constraining betas with mlogit package

2011-08-15 Thread Bert Gunter
Hi Rolf: Maybe. But I'm not sure whether the OP wants two levels of a single variable to have the same coefficient, or two different categorical variables in some way, or two different numeric variables, or... Maybe it's obvious, but I thought it fairer to the OP to make clear that I was not a re

Re: [R] constraining betas with mlogit package

2011-08-15 Thread Bert Gunter
Well, of course that doesn't work for categorical covariates (duhhh!) -- so I'll just stop at my first clause, "I don't know." Sorry. I would suggest that a better specification of the model and the constraints may elicit better and faster responses. -- Bert On Mon, Aug 15, 2011 at 3:53 PM, Ber

Re: [R] 2 matrix scatter x [a lot]

2011-08-15 Thread Dennis Murphy
Hi: Here's one way, using the following reproducible example. # Method 1: the variable names are the same in each data frame # Create two separate data frames ds1 <- data.frame(x1 = rnorm(10), x2 = rnorm(10), x3 = rnorm(10)) ds2 <- data.frame(x1 = rnorm(10), x2 = rnorm(10), x3 = rnorm(10)) # Mel

Re: [R] constraining betas with mlogit package

2011-08-15 Thread Bert Gunter
I don't know the answer in general, but for the specific constraint of two coefficients being the same, I would assume that you should create a new covariate which is the sum of the two individual ones and fit this single combined covariate instead of the two separate ones. Cheers, Bert On Mon, A

Re: [R] Regression - how to deal with past values?

2011-08-15 Thread Bert Gunter
This may not be helpful, but this sounds difficult enough that you should work with a local statistician rather than trying to get remote consulting here. -- Bert On Mon, Aug 15, 2011 at 3:00 PM, Eduardo M. A. M.Mendes wrote: > Dear R-users > > > > I need to fit a nonlinear model to a piece of d

[R] 2 matrix scatter x [a lot]

2011-08-15 Thread Ben qant
Hello, I'm pretty new to R. Basically, how do I speed up the for loop below. Or better yet, get rid of the for loop all together. objective: plot two data sets column against column by index. These data sets have alot NA's. Some columns are all NA's. I need the plots to overlay. I don't like the

[R] Regression - how to deal with past values?

2011-08-15 Thread Eduardo M. A. M.Mendes
Dear R-users I need to fit a nonlinear model to a piece of data. The model to be fitted uses past values of the input and the ouput - something like y(k) ~ f(y(k-1),y(k-2),u(k),u(k-1) ) (k is time index). As far as I know I could use earth(MARS), nnet and etc but I am not sure how to deal

Re: [R] plotting segments only and in color

2011-08-15 Thread Dennis Murphy
Hi: Here's one approach using the ggplot2 package: Y=c(15,14,23,18,19,9,19,13) Xa=c(17,22,21,18,19,25,8,19) Xb=c(22,22,29,34,19,26,17,22) dd <- data.frame(Y, Xa, Xb) ggplot(dd) + geom_segment(aes(x = Xa, xend = Xb, y = Y, yend = Y, colour = Xb - Xa), size = 2) + geom_po

[R] constraining betas with mlogit package

2011-08-15 Thread Essers, Jonah
I have been using the mlogit package but can't seem to figure out how to make constraints on the beta coefficients. For example, I would like to force that two of my beta's are equal to each other. Thanks in advance. Jonah __ R-help@r-project.org mai

Re: [R] calibration curve for cph()

2011-08-15 Thread array chip
is there a R function that produces calibration curve on an independetn data automatically, just like what calibrate() does on the training data itself? Thanks John From: Comcast Cc: "r-help@r-project.org" Sent: Monday, August 15, 2011 2:04 PM Subject: Re:

Re: [R] update() ignores object

2011-08-15 Thread Sverre Stausland
That works! Thanks. On Mon, Aug 15, 2011 at 5:09 PM, Bert Gunter wrote: > Sverre: > > As your reproducible example shows, the problem is that the string > "y1:y2" is not an acceptable term of the formula. One way round this > is simply convert the non-string part of the formula to a string, pase

Re: [R] Get significant codes from a model output fit with GEE package

2011-08-15 Thread Dennis Murphy
Hi: If you're asking about the p-values, here's a reproducible example from the gee package: library('gee') m <- gee(breaks ~ tension, id=wool, data=warpbreaks, corstr="exchangeable") # Nosing around the summary method return object: > names(summary(m)) [1] "call""version"

Re: [R] area under the curve

2011-08-15 Thread Comcast
Why re-invent? Use lrm in rms. -- David Sent from my iPhone On Aug 15, 2011, at 10:07 AM, Mariana Varela wrote: > HI there, I have been trying to use a code posted on R help to be able to > calculate area under the curve for complicated data points and there seems to > be an issue with th

Re: [R] can't install plotrix

2011-08-15 Thread Ben Bolker
Alison Waller embl.de> writes: > I'm having problems installing plotrix. I tried installing it > through install.packages, and from the > unix command line, but each time it seems to stall when > it is installing the help indices. > > has anyone had this same problem, is this package still ma

Re: [R] update() ignores object

2011-08-15 Thread Bert Gunter
Sverre: As your reproducible example shows, the problem is that the string "y1:y2" is not an acceptable term of the formula. One way round this is simply convert the non-string part of the formula to a string, pase it with your term, and then reconvert it to a formula: update(my.lm,formula(paste(

Re: [R] calibration curve for cph()

2011-08-15 Thread Comcast
Build a prediction function using 'Function' that gets applied to set2. Calibrate and validate. -- David Sent from my iPhone On Aug 15, 2011, at 11:31 AM, array chip wrote: > Hi, the calibrate.cph() function in rms package generate calibration curve > for Cox model on the same dataset wher

Re: [R] Labelling all variables at once (using Hmisc label)

2011-08-15 Thread Sarah Goslee
On Mon, Aug 15, 2011 at 3:53 PM, Monsieur Do wrote: > I have a dataset and a list of labels. I simply want to apply the labels to > the variables, all at once. The only way I was able to do it was using a loop: > > for (i in 1:length(data)) label(data[,i]) <- data.labels[i] > > I'd like to f

[R] Labelling all variables at once (using Hmisc label)

2011-08-15 Thread Monsieur Do
I have a dataset and a list of labels. I simply want to apply the labels to the variables, all at once. The only way I was able to do it was using a loop:     for (i in 1:length(data))  label(data[,i]) <- data.labels[i] I'd like to find the non-loop way to do it, using apply or the like... Any h

[R] can't install plotrix

2011-08-15 Thread Alison Waller
Hi all, I'm having problems installing plotrix. I tried installing it through install.packages, and from the unix command line, but each time it seems to stall when it is installing the help indices. has anyone had this same problem, is this package still maintained ? any help? thanks > inst

[R] area under the curve

2011-08-15 Thread Mariana Varela
HI there, I have been trying to use a code posted on R help to be able to calculate area under the curve for complicated data points and there seems to be an issue with the code: no "b" object found. I am not a good R user and can't find were the problem is. Any help? Thanks!! This is the code (

[R] Venn Diagrams

2011-08-15 Thread Phil Schnarrs
Hello All, I am currently using the vennDiagram function in the limma pkg to construct venn diagrams. I would like to change the size of the circles based upon the n of each set (if that makes sense). Does anyone have any ideas of how to do this? Thanks, Phil [[alternative HTML versi

[R] plotting segments only and in color

2011-08-15 Thread Johannes Radinger
Hello, I've a question concerning the display of interval data. A sample dataset where X is an interval between Xa and Xb which should be displayed: Y=c(15,14,23,18,19,9,19,13) Xa=c(17,22,21,18,19,25,8,19) Xb=c(22,22,29,34,19,26,17,22) X = (Xa+Xb)/2 It's easily possible to plot the mean of the

[R] Get significant codes from a model output fit with GEE package

2011-08-15 Thread david oseguera montiel
Does anyone know how could I get the significant codes from mixed model output fitted with a GEE package? The output I got is the following: GEE: GENERALIZED LINEAR MODELS FOR DEPENDENT DATA gee S-function, version 4.13 modified 98/01/27 (1998) Model: Link: Logit Varia

[R] update() ignores object

2011-08-15 Thread Sverre Stausland
Hi all, I'm extracting the name of the term in a regression model that dropterm specifies as the least significant one, and I'm assigning this name to an object. However, when I use update(), it ignores this object. Is there a way I can make it not ignore it? A reproducible example is below: > lm

Re: [R] ggplot in a function confusion!

2011-08-15 Thread Dennis Murphy
Hi: Try this: df<-data.frame(x=1:10,y=1:10) plot.fun.one <- function(dff, x.var, y.var) print(ggplot(dff, aes_string(x = x.var, y = y.var)) + geom_point() ) plot.fun.two <- function(dff, x.var, y.var) { x <- names(dff)[x.var] y <- names(dff)[y.var] print(ggplot(dff, aes_string(x = x,

[R] Indexing Permutation Values

2011-08-15 Thread Edward Patzelt
R-help - This code iterates over a function with 2 free parameters to find a list of values (which are the number of incorrect predictions for a computational model). I want to find the values of i,e when there is the minimum number of incorrect predictions. In other words, the value of "i" and

Re: [R] Smooth ecdf

2011-08-15 Thread Bert Gunter
... and ?densityplot in the lattice package. Please also note that you could have avoided posting just by typing help.search("density") at the RGui prompt. Please use R's Help facilities before posting. -- Bert On Mon, Aug 15, 2011 at 11:44 AM, Jorge Ivan Velez wrote: > Hi Jeff, > Take a look a

[R] Stopping criterion in option "control" of BBsolve( )

2011-08-15 Thread Tingting Zhan
Dear Dr. Gilbert, Dr. Varadhan and all R-help list members, I'm using the function BBsolve( ) and I have some questions on the stopping criterion "maxit" and "noimp" specified in the option "control". Here are two such examples I'm having problem with.In these two examples, the function BB

Re: [R] rollapply.zoo() with na.rm=TRUE

2011-08-15 Thread Gabor Grothendieck
On Mon, Aug 15, 2011 at 6:51 AM, Giles wrote: > Thanks for that Gabor, it works fine from the development version > you've pointed to. > > There is in addition a performance issue: the following benchmark ran > in under 0.2s in the previous version, now consistently shows elapsed > time over 14s o

Re: [R] Smooth ecdf

2011-08-15 Thread Jorge Ivan Velez
Hi Jeff, Take a look at ?density HTH, Jorge On Mon, Aug 15, 2011 at 2:38 PM, Jeffrey Joh <> wrote: > > > Is it possible to smooth an ecdf plot and get a probability density plot? > I have about 8000 points and I was hoping to get a density curve instead of > a histogram. > > > > Jeff > _

Re: [R] accumulative grouping of time series

2011-08-15 Thread Dennis Murphy
Hi: Thank you for the reproducible example and expected result. Here's one approach: library('plyr') x <- data.frame(a=1:10, b=11:20, t=c(1,1,1,2,2,2,3,3,3,3)) x$sdif <- cumsum(with(x, a - b)) subfun <- function(d) tail(d[c('t', 'sdif')], 1) ddply(x, 't', subfun) t sdif 1 1 -30 2 2 -60 3 3

[R] Smooth ecdf

2011-08-15 Thread Jeffrey Joh
Is it possible to smooth an ecdf plot and get a probability density plot? I have about 8000 points and I was hoping to get a density curve instead of a histogram. Jeff __ R-help@r-project.org mailing list htt

Re: [R] Selecting section of matrix

2011-08-15 Thread David Winsemius
On Aug 15, 2011, at 6:09 AM, mdvaan wrote: Hi, I have a question concerning the selection of data. Let's say that given list h created below, I would like to select a section of the 1999 matrix. For a case (rownames and colnames) I would like to select the cells that have a value > 0. S

[R] calibration curve for cph()

2011-08-15 Thread array chip
Hi, the calibrate.cph() function in rms package generate calibration curve for Cox model on the same dataset where the model was derived using bootstrapping or cross-validation. If I have the model built on dataset 1, and now I want to produce a calibration curve for this model on an independent

Re: [R] how can I read a xlsx file

2011-08-15 Thread Jorge Ivan Velez
Hi Albert, Another option would be the following: install.packages('gdata') require(gdata) ?read.xlsx HTH, Jorge On Mon, Aug 15, 2011 at 11:19 AM, albert coster <> wrote: > Hello, > > How can I read a xlsx file using xlsx package? > > Thanks > > Albert > >[[alternative HTML version de

Re: [R] Help on how to use predict

2011-08-15 Thread Eduardo M. A. M.Mendes
Hi there Many thanks. I will try to follow what you two said. Meanwhile I use the dirty solution that I have just come across. Cheers Ed -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: Monday, August 15, 2011 1:36 PM To: David Winsemius Cc: Eduardo

Re: [R] gsub wildcard

2011-08-15 Thread Rebecca Gray
Hi Peter, Well the problem is that I need to also move the ":" to the front of the bracketed expression, although I like the simplicity of your statement. I cannot replace all of the "[" with ":[" because I am actually just using a small example from a large file, and there are many more "[" that

Re: [R] gsub wildcard

2011-08-15 Thread Peter Langfelder
On Mon, Aug 15, 2011 at 10:34 AM, Rebecca Gray wrote: > Hello all, > > I have what I think is a simple question but I've been unable to solve it. I > have the following string: > > A[&states=1]:[&rate=2]425, B[&states=3]:[&rate=5]500 > > I would like to combine the two expressions in the [], so th

[R] temporal disaggregation

2011-08-15 Thread Sebastian Kruk
Dear R-users, I have an anual info of gross product and I would like to disaggregate to trimestral data. Can I import a matlab library of Quilis? ( http://www.mathworks.com/matlabcentral/fileexchange/24438-temporal-disaggregation-library ) Thanks, Sebastián. ___

[R] gsub wildcard

2011-08-15 Thread Rebecca Gray
Hello all, I have what I think is a simple question but I've been unable to solve it. I have the following string: A[&states=1]:[&rate=2]425, B[&states=3]:[&rate=5]500 I would like to combine the two expressions in the [], so that only one set of [] is present after each letter, so that I have t

[R] FW: FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread B Jessop
Tyler, My apology. It does help to type correctly and eliminate unnecessary spaces in commands. The following does work correctly: levels(Data1$Site) <- list(Fw = c("AB"), Est = c("DE")) Thanks very much, BJ > From: deel...@hotmail.com >

Re: [R] how can I read a xlsx file

2011-08-15 Thread Mikhail Titov
I prefer RODBC and odbcConnectExcel this way I can query subsets with SQL. Mikhail > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Ivan Calandra > Sent: Monday, August 15, 2011 10:28 AM > To: r-help@r-project.org > Subject: R

[R] ggplot in a function confusion!

2011-08-15 Thread Justin Haynes
Whats going on here? df<-data.frame(x=1:10,y=1:10) ggplot()+geom_point(data=df,aes(x=x,y=y)) ## this is the normal usage right? ggplot()+geom_point(data=df,aes(x=df[,1],y=df[,2])) ## but I can also feed it column indices ggplot()+geom_point(aes(x=df[,'x'],y=df[,'y'])) ## or column names. ##

[R] lattice: How to get log base for each axis inside panel function?

2011-08-15 Thread Mikhail Titov
Hello! I'd like to have a function to draw correct grid while using log axis with xyplot from lattice package. Right now I have the following code inside of my panel function: lim <- current.panel.limits() v <- latticeExtra:::logTicks(2^lim$xlim, loc=1) h <- latticeExtra:::logTicks(2^lim$ylim,

Re: [R] Help on how to use predict

2011-08-15 Thread Duncan Murdoch
On 11-08-15 12:21 PM, David Winsemius wrote: Eduardo; I think you would be more successful if you put your data in a dataframe, offered it to lm with column names only in the formula, and then used the newdata argument with predict with the column names matching the column names in the original

[R] MARGIN in sweep refers to a specific column in a second df

2011-08-15 Thread Patrick Hausmann
Dear R folks, I am doing some calculations over an array using sweep and apply. # Sample Data (from help 'addmargins') Aye <- sample(c("Yes", "Si", "Oui"), 177, replace = TRUE) Bee <- sample(c("Hum", "Buzz"), 177, replace = TRUE) Sea <- sample(c("White", "Black", "Red", "Dead"), 177, replace = T

Re: [R] Help on how to use predict

2011-08-15 Thread David Winsemius
Eduardo; I think you would be more successful if you put your data in a dataframe, offered it to lm with column names only in the formula, and then used the newdata argument with predict with the column names matching the column names in the original data. -- David. On Aug 15, 2011, at 5

Re: [R] Read variable column width data

2011-08-15 Thread Duncan Murdoch
On 15/08/2011 11:47 AM, R Saba wrote: Reading data with variable column widths. Here are several lines of a txt data set I would like to read. The number of variables is fixed at 13 . The problem is how to read the first variable when it can contain blank space-- for example " Alabama (Seasonally

[R] Read variable column width data

2011-08-15 Thread R Saba
Reading data with variable column widths. Here are several lines of a txt data set I would like to read. The number of variables is fixed at 13 . The problem is how to read the first variable when it can contain blank space-- for example " Alabama (Seasonally Adjusted)" , "St. Clair", etc. Alabama

Re: [R] Problem loading rJava...

2011-08-15 Thread Joseph Magagnoli
Brian, I believe I had a similar problem. Make sure you have JDK (*sun-java6-jdk) * installed as well. Here is a link to a JDK install guide http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/ On Mon, Aug 15, 2011 at 10:18 AM, Brian Lunergan wrote: > Morning All: > > Ha

[R] Problem loading rJava...

2011-08-15 Thread Brian Lunergan
Morning All: Having problems installing this one into my R setup and wondered if anyone on the list had the same problem and found a workable solution. First to the system particulars: OS is the Hardy Heron edition of Ubuntu Linux R version is 2.13.1 Java installation is sun-java6 Next up is th

Re: [R] Plot from function

2011-08-15 Thread rmje
Problem solved! -- View this message in context: http://r.789695.n4.nabble.com/Plot-from-function-tp3744428p3744695.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Plot from function

2011-08-15 Thread rmje
It workes using "" But what is this: > p <- plot_mi_time(hakat, "hsa-miR-100") X1h X4h X9h X15h X18h X21h hsa-miR-100 384 1038 1503 1511 2603 2899 *Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ* -- View this message in context: http://r.789695.n4.

Re: [R] how can I read a xlsx file

2011-08-15 Thread Ivan Calandra
?read.xlsx Le 8/15/2011 17:19, albert coster a écrit : Hello, How can I read a xlsx file using xlsx package? Thanks Albert [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Plot from function

2011-08-15 Thread rmje
> ls(hakat) [1] "X15h" "X18h" "X1h" "X21h" "X4h" "X9h" -- View this message in context: http://r.789695.n4.nabble.com/Plot-from-function-tp3744428p3744592.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Selecting section of matrix

2011-08-15 Thread mdvaan
Hi, I have a question concerning the selection of data. Let's say that given list h created below, I would like to select a section of the 1999 matrix. For a case (rownames and colnames) I would like to select the cells that have a value > 0. So for case 8025 8025 8026 8027 802511

Re: [R] Extracting information from lm results (multiple model runs)

2011-08-15 Thread R. Michael Weylandt
Two ways to do it, both of which come down to forcing R to recognize "(" as a string element than an actual parenthesis: x = data.frame(1:3, 4:6) colnames(x) = c("(Intercept)","Slope") x$"(Intercept)" or x[,"(Intercept)"] # Works with or without the comma in slightly different ways -- figure out

[R] how can I read a xlsx file

2011-08-15 Thread albert coster
Hello, How can I read a xlsx file using xlsx package? Thanks Albert [[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.o

Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread Ivan Calandra
You might want to compare the brackets in your code and in Tyler's Ivan Le 8/15/2011 16:36, B Jessop a écrit : Tyler, Tried your solution: levels (Data1$Site<- list(Fw = c("AB"), Est = c("DE"))) but still got a NULL response to str(Data1) and an alternating list of Fw, Est, Fw, Est unde

Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread Bert Gunter
Well, it looks like the standard advice here applies to both poster and responder: try reading the Help (carefully): ?factor Example: > z <- factor(letters[1:3]) > z [1] a b c Levels: a b c > factor(z,labels=letters[4:6]) [1] d e f Levels: d e f > factor(z,labels=letters[3:1]) [1] c b a Levels: c

Re: [R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread padmanabhan . vijayan
Try recode from Deducer package. Sent from my BlackBerry® smartphone from !DEA -Original Message- From: B Jessop Sender: r-help-bounces@r-project.orgDate: Mon, 15 Aug 2011 11:36:07 To: Subject: [R] FW: Renaming levels of a factor in a dataframe Tyler, Tried your solution: levels

[R] FW: Renaming levels of a factor in a dataframe

2011-08-15 Thread B Jessop
Tyler, Tried your solution: levels (Data1$Site <- list(Fw = c("AB"), Est = c("DE"))) but still got a NULL response to str(Data1) and an alternating list of Fw, Est, Fw, Est under Site when looked at in the Data editor in R console. The use of the "levels" function would seem to be appro

Re: [R] Scaling problem in optim()

2011-08-15 Thread Ravi Varadhan
There is an error in your call to `optim'. The`lower' bound is incorrect: lower=c(rep(-1,n),1e-5,1e-5,1e5) This should be: lower=c(rep(-1,n),1e-5,1e-5,1e-5) I am not sure if this fixes the problem, but it is worth a try. I do not understand your scaling. From the lower and upper bounds it se

[R] Obtaining parameters in LCA

2011-08-15 Thread David Joubert
Hello, I am using poLCA to run standard latent class analyses. Is there any way that I can get parameters for each predictors, in terms of their association with the latent variable ? Thank you, David Joubert [[alternative HTML version delet

Re: [R] Gradients and fitting curves in R

2011-08-15 Thread Jim Silverton
Hello all, I have some points for x and f(x). I want to fit the best curev through these points and find the value of x and f(x) for which the gradient is -1. Anyone knows if this can be done in R? -- Thanks, Jim. [[alternative HTML version deleted]]

Re: [R] Extracting information from lm results (multiple model runs)

2011-08-15 Thread R. Michael Weylandt
I can't help with the questions on pooling regressions, but for the question about data-frame usage, I'll note two things. One, > x = data.frame(y = 1:3, z = 4:6) > is.data.frame(x) TRUE > is.data.frame(t(x)) FALSE > is.data.frame(as.data.frame(t(x))) TRUE Two, you'll need to check that your r

Re: [R] Plot from function

2011-08-15 Thread Duncan Murdoch
On 11-08-15 7:55 AM, rmje wrote: *I have the following function:* /plot_mi_time = function(mdata, miname) { mdata2 = mdata[row.names(hakat) == miname, ] You passed the expression hsa-miR-98 as miname. The simplest fix is to pass "hsa-miR-98" instead. A more complicated alternative is t

Re: [R] MCMC regress, using runif()

2011-08-15 Thread R. Michael Weylandt
Two things, 1) You need to use square brackets in this case because model is an object, not a function. 2) You probably want to use a list object to store a whole bunch of model objects so you'll want double brackets. model = list(NULL) for (i in 1:1000) { model[[i]] <- lm(Y~X1+X2()) } This,

Re: [R] Plot from function

2011-08-15 Thread R. Michael Weylandt
I believe it's a problem in your variable name "hsa-miR-98". R wants to interpret that as "hsa" less "miR" less 98. Since you don't have a variable called "hsa", R (rightly) complains. Call ls() and see what R thinks your variables are named -- that will hopefully make the problem evident. Hope t

[R] Plot from function

2011-08-15 Thread rmje
*I have the following function:* /plot_mi_time = function(mdata, miname) { mdata2 = mdata[row.names(hakat) == miname, ] print(mdata2) xcoords <- c(1,1,2,2,3,3,4,4,5,5,6,6) plot(c(xcoords), mdata2, xaxt="n", ylab="Expression", xlab="Time(h)", , main=miname) axis(1, at=xcoords

Re: [R] R-help Digest, Vol 102, Issue 16

2011-08-15 Thread fraenzi . korner
Wir sind bis am 20. August in den Ferien und werden keine e-mails beantworten. Bei dringenden Fällen melden Sie sich bei Stefanie von Felten steffi.vonfel...@oikostat.ch We are on vacation until 20. August. In urgent cases, please contact Stefanie von Felten steffi.vonfel...@oikostat.ch __

  1   2   >