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

2011-08-15 Thread Petr PIKAL
Hi Here's an example of relevel used to relevel and combine groups InsectSprays2-InsectSprays levels(InsectSprays2$spray) levels(InsectSprays2$spray)-list(new1=c(A,C),YEPS=c(B,D,E),LASTLY=F) levels(InsectSprays2$spray) InsectSprays2 So for you try... levels (Data1$Site) -

[R] Missing datasets (2.13.1)

2011-08-15 Thread Sierra Bravo
Dear all How does one resolve the variance between the actual availability of data sets in the default implementation with those mentioned in the documentation? I am unable to attach some of the datasets, even though help() is available for the same datasets. For example, ToothGrowth is a dataset

[R] write.table extra column

2011-08-15 Thread Mike Hunter
In the following data.frame there are 6 columns, but 7 are written to the CSV file. install.packages(pmlr) library(pmlr) data(enzymes) write.table(enzymes, sep=,, eol=\n,file=albert.csv) __ R-help@r-project.org mailing list

[R] Odp: write.table extra column

2011-08-15 Thread Petr PIKAL
Hi In the following data.frame there are 6 columns, but 7 are written to the CSV file. install.packages(pmlr) library(pmlr) data(enzymes) write.table(enzymes, sep=,, eol=\n,file=albert.csv) see row.names option in ?write.table Regards Petr

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Uwe Ligges
On 15.08.2011 06:33, Sierra Bravo wrote: Dear all How does one resolve the variance between the actual availability of data sets in the default implementation with those mentioned in the documentation? I am unable to attach some of the datasets, even though help() is available for the same

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Dennis Murphy
data(ToothGrowth) makes it available in your workspace. data(ToothGrowth) ls() [1] ToothGrowth str(ToothGrowth) 'data.frame': 60 obs. of 3 variables: $ len : num 4.2 11.5 7.3 5.8 6.4 10 11.2 11.2 5.2 7 ... $ supp: Factor w/ 2 levels OJ,VC: 2 2 2 2 2 2 2 2 2 2 ... $ dose: num 0.5 0.5

Re: [R] write.table extra column

2011-08-15 Thread Jeff Newmiller
Yup. Read ?write.csv and note the row.names argument. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer

Re: [R] Getting data from an *.RData file into a data.frame object.

2011-08-15 Thread Ivan Calandra
I like using saveObject() and loadObject() from package R.utils because you can assign the data to a new object. Like this: library(R.utils) saveObject(df, file=file.Rbin) df2 - loadObject(file.Rbin) HTH, Ivan Le 8/12/2011 21:38, peter dalgaard a écrit : On Aug 12, 2011, at 21:12 , Ed Heaton

Re: [R] Splitting data

2011-08-15 Thread Marina de Wolff
Dear Michael, I adjusted the code a bit; d1 = DataSplitsCore(Data1[(1:nr1)], Data1[-(1:nr1)], alpha = alpha, level = level + 1) d2 = DataSplitsCore(Data2[(1:nr2)], Data2[-(1:nr2)], alpha = alpha, level = level +1) The code stops when palpha, which is what I wanted. Only problem is that it

Re: [R] Splitting data

2011-08-15 Thread Marina de Wolff
By the way, I indeed want to get the data returned. From: marinadewo...@hotmail.com To: michael.weyla...@gmail.com CC: r-help@r-project.org Subject: RE: [R] Splitting data Date: Mon, 15 Aug 2011 10:32:04 +0200 Dear Michael, I adjusted the code a bit; d1 =

[R] MCMC regress, using runif()

2011-08-15 Thread Johannes Radinger
Hello, just to follow up a question from last week. Here what I've done so far (here an example): library(MCMCpack) Y=c(15,14,23,18,19,9,19,13) X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52) X2a=c(17,22,21,18,19,25,8,19) X2b=c(22,22,29,34,19,26,17,22) X2 - function()runif(length(X2a), X2a, X2b)

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Sierra Bravo
Thanks Uwe, Dennis. However, I'm unable to make progress...this is what I get: data(ToothGrow) Warning message: In data(ToothGrow) : data set 'ToothGrow' not found ToothGrow Error: object 'ToothGrow' not found TIA s.b. -- View this message in context:

Re: [R] write.table extra column

2011-08-15 Thread Mike Hunter
Thanks! On Mon, Aug 15, 2011 at 12:55 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Yup. Read ?write.csv and note the row.names argument. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Jeff Newmiller
That would be because ToothGrow is not ToothGrowth. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Uwe Ligges
On 15.08.2011 10:26, Sierra Bravo wrote: Thanks Uwe, Dennis. However, I'm unable to make progress...this is what I get: data(ToothGrow) Warning message: In data(ToothGrow) : data set 'ToothGrow' not found ToothGrow Error: object 'ToothGrow' not found What happens if you type

Re: [R] PCA Using prcomp()

2011-08-15 Thread S Ellison
-Original Message- christopher stratton Sent: 14 August 2011 22:22 Subject: [R] PCA Using prcomp() From the results generated by prcomp(), is there a way to print a matrix showing the contributions of the original variables to each PC? Sounds like you're looking for the

Re: [R] Scaling problem in optim()

2011-08-15 Thread Ben Bolker
Rebekka Schibli rebekka_schibli at gmx.ch writes: I am using the function optim and I get the error message ABNORMAL_TERMINATION_IN_LNSRCH. Reason for this could be a scaling problem. Thus, I used parscale in order to scale the parameters. But I still have the error message. For example,

[R] Help on how to use predict

2011-08-15 Thread Eduardo M. A. M.Mendes
Dear R-Users My problem is quite simple: I need to use a fitted model to predict the next point (that is, just one single point in a curve). The data was divided in two parts: identification (x and y - class matrix) and validation (xt and yt - class matrix). I don't use all values in x

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Sierra Bravo
Thanks Jeff, Uwe. The last case was indeed because of a typo, where I typed ToothGrow instead of ToothGrowth. Many apologies...! s.b. -- View this message in context: http://r.789695.n4.nabble.com/Missing-datasets-2-13-1-tp3743896p3744249.html Sent from the R help mailing list archive at

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

2011-08-15 Thread Johannes Radinger
Hello... just some additional thoughts: Maybe I can try it in a simple way with a repeated lm-regression, like: Y=c(15,14,23,18,19,9,19,13) X1=c(0.2,0.6,0.45,0.27,0.6,0.14,0.1,0.52) X2a=c(17,22,21,18,19,25,8,19) X2b=c(22,22,29,34,19,26,17,22) X2 - function()runif(length(X2a), X2a, X2b) for

[R] accumulative grouping of time series

2011-08-15 Thread Ernest Adrogué
HI there, Consider a data set like this: x - data.frame(a=1:10, b=11:20, t=c(1,1,1,2,2,2,3,3,3,3)) x a b t 1 1 11 1 2 2 12 1 3 3 13 1 4 4 14 2 5 5 15 2 6 6 16 2 7 7 17 3 8 8 18 3 9 9 19 3 10 10 20 3 Here x$t is a vector of integers that represent a moment in time. I

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Rolf Turner
On 15/08/11 20:26, Sierra Bravo wrote: Thanks Uwe, Dennis. However, I'm unable to make progress...this is what I get: data(ToothGrow) Warning message: In data(ToothGrow) : data set 'ToothGrow' not found ToothGrow Error: object 'ToothGrow' not found. You need to spell it correctly! It's

Re: [R] Missing datasets (2.13.1)

2011-08-15 Thread Philippe Grosjean
On 15/08/11 10:44, Uwe Ligges wrote: On 15.08.2011 10:26, Sierra Bravo wrote: Thanks Uwe, Dennis. However, I'm unable to make progress...this is what I get: data(ToothGrow) Warning message: In data(ToothGrow) : data set 'ToothGrow' not found ToothGrow Error: object 'ToothGrow' not

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

2011-08-15 Thread Giles
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 on a Xeon with Windows. It's unaffected if I use the

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

2011-08-15 Thread Johannes Radinger
Just to inform: I posted that before in R-sig-ecology but as it might be interesting also for other useRs, I post it also to the general r-user list: Hello Alexandre, thank you very much. I also found another way to extract summarizing information from lm results over e.g. 1000 repeated model

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

[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] 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 this

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 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 to

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 row

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]]

[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

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

[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 appropriate

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 deel...@hotmail.com Sender: r-help-bounces@r-project.orgDate: Mon, 15 Aug 2011 11:36:07 To: r-help@r-project.org Subject: [R] FW: Renaming levels of a factor in a dataframe

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 b a

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 under

[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

[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 which

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 list

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

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:

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

[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

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 ff...@ncf.ca wrote: Morning

[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] 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

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

[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 = TRUE) (A - table(Aye,

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] 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,

[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. ##

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: Re:

[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 To:

[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 the

[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.

Re: [R] gsub wildcard

2011-08-15 Thread Peter Langfelder
On Mon, Aug 15, 2011 at 10:34 AM, Rebecca Gray atlas...@gmail.com 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

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 are

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:

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 deleted]]

[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

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.

[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

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

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] rollapply.zoo() with na.rm=TRUE

2011-08-15 Thread Gabor Grothendieck
On Mon, Aug 15, 2011 at 6:51 AM, Giles giles.heyw...@amberalpha.com 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

[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

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 jorgeivanve...@gmail.com wrote: Hi

[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 e

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, y =

[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:

[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

[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

[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

[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] 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

[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

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 nonaupourr...@yahoo.ca 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]

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 arrayprof...@yahoo.com wrote: Hi, the calibrate.cph() function in rms package generate calibration curve for Cox model on

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:

Re: [R] can't install plotrix

2011-08-15 Thread Ben Bolker
Alison Waller alison.waller at 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

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 mariana.var...@glasgow.ac.uk 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

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] callversion

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 gunter.ber...@gene.com 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

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 dwinsem...@comcast.net Cc: r-help@r-project.org r-help@r-project.org Sent:

[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

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) +

[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

[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

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 emammen...@gmail.com wrote: Dear R-users I need to fit a nonlinear model

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,

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)) # Melt

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, Bert

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

[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 some

[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

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 To:

[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

  1   2   >