[R] rcart - classification and regression trees (CART)

2009-12-16 Thread Katie N
Hi, I am trying to use CART to find an ideal cut-off value for a simple diagnostic test (ie when the test score is above x, diagnose the condition). When I put in the model fit=rpart(outcome ~ predictor1(TB144), method=class, data=data8) sometimes it gives me a tree with multiple nodes for

Re: [R] Reshape a data set

2009-12-16 Thread xavier . chardon
Hi, You need an additional id column in your data frame, which represents the replication number within each subject (the 1, 2 in the column headings after reshaping in what you showed). test - data.frame(subject=c(1,1,2,2,3,3), coder=c(1,2,3,2,2,1), score=c(20,30,10,5,15,NA),

[R] Odp: comparison of these types is not implemented

2009-12-16 Thread Petr PIKAL
Hi you have got some response about how to avoid an error but I am curious what you really want to achieve. lll-as.list(rnorm(15)) cbind(unlist(lll),order(unlist(lll))) [,1] [,2] [1,] 0.93344282 13 [2,] 0.63501664 14 [3,] 0.059764468 [4,] -0.491819449 [5,]

[R] lasso regression coefficients

2009-12-16 Thread Eleni Christodoulou
Dear list, I have been trying to apply a simple lasso regression on a 10-element vector, just to see how this method works so as to later implement it on larger datasets. I thus create an input vector x: * x=rnorm(10)* I add some noise *noise=runif(n=10, min=-0.1, max=0.1)* and I

Re: [R] Creating bibtex file of all installed packages?

2009-12-16 Thread Achim Zeileis
On Wed, 16 Dec 2009, Romain Francois wrote: On 12/16/2009 08:32 AM, Achim Zeileis wrote: On Tue, 15 Dec 2009, Michael Friendly wrote: Achim and others: Achim's solution could be directly usable if it also added a BibTeX key, perhaps just the name of the package to the '@Manual{,' initial

Re: [R] Creating bibtex file of all installed packages?

2009-12-16 Thread S Devriese
On 12/16/2009 08:32 AM, Achim Zeileis wrote: On Tue, 15 Dec 2009, Michael Friendly wrote: Achim and others: Achim's solution could be directly usable if it also added a BibTeX key, perhaps just the name of the package to the '@Manual{,' initial line of each. I wrapped the previous

Re: [R] Creating bibtex file of all installed packages?

2009-12-16 Thread Achim Zeileis
On Wed, 16 Dec 2009, S Devriese wrote: On 12/16/2009 08:32 AM, Achim Zeileis wrote: On Tue, 15 Dec 2009, Michael Friendly wrote: Achim and others: Achim's solution could be directly usable if it also added a BibTeX key, perhaps just the name of the package to the '@Manual{,' initial line of

[R] How to find the significant digits of a number?

2009-12-16 Thread Xiang Wu
Is there a function in R that could find the significant digit of a specific number? Such as for 3.1415, return '5'? Thanks in advance. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Gustaf Rydevik
On Wed, Dec 16, 2009 at 10:26 AM, Xiang Wu xiang@gmail.com wrote: Is there a function in R that could find the significant digit of a specific number? Such as for 3.1415, return '5'? Thanks in advance. [[alternative HTML version deleted]]

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Romain Francois
On 12/16/2009 10:26 AM, Xiang Wu wrote: Is there a function in R that could find the significant digit of a specific number? Such as for 3.1415, return '5'? Thanks in advance. Not sure to understand what you mean, but you can have a look at ?signif Something like this perhaps: foo -

Re: [R] Creating bibtex file of all installed packages?

2009-12-16 Thread S Devriese
On 12/16/2009 10:12 AM, Achim Zeileis wrote: On Wed, 16 Dec 2009, S Devriese wrote: On 12/16/2009 08:32 AM, Achim Zeileis wrote: On Tue, 15 Dec 2009, Michael Friendly wrote: Achim and others: Achim's solution could be directly usable if it also added a BibTeX key, perhaps just the name

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Linlin Yan
Try this: f - function(x) length(gregexpr([[:digit:]], as.character(x))[[1]]) f(3.14) [1] 3 f(3.1415) [1] 5 f(3.14159265) [1] 9 On Wed, Dec 16, 2009 at 1:39 PM, Xiang Wu xiang@gmail.com wrote: Is there a function in R that could find the significant digit of a specific number? Such as

[R] Stata files

2009-12-16 Thread David Scott
I have a client who uses Stata 11. Can anyone advise me on ways of transferring data from this version of Stata to R? Reading the documentation for read.dta in package foreign it seems it only allows for versions up to Stata 10. I don't know Stata at all but a bit of poking around on their

[R] MAPE and RMSE in R

2009-12-16 Thread ruchita gupta
Hello After performing NLS estimates for some sigmoid model(like logistic growth model and Gompertz growth models), how can we get the RMSE(root mean square error) and MAPE(mean absolute percentage error) in R statistical tool for comparison between two models Thanks Ruchita

Re: [R] Stata files

2009-12-16 Thread Prof Brian Ripley
Have you tried read.dta? The URL on the help page for read.dta now says 'Stata 11 help for dta', but it seems to document the same format (114) as Stata 10 (see the value section). So in so far as Stata is telling us, it looks like Stata 10 and 11 use the same format (as Stata 8 and 9 did).

Re: [R] Read dataset in R language.

2009-12-16 Thread Nancy Adam
Hi all, I tried many things to read any dataset but I receive different error messages every time. One new message is: vector size specified is too large Can any one please send any part from any dataset just for testing a regression system and to know where is the problem?? Many thanks,

Re: [R] expand.grid applied to a matrix

2009-12-16 Thread Jean-Christophe Domenge
Many thanks for both replying and fixing the typo! jc On Tue, Dec 15, 2009 at 21:20, Charles C. Berry cbe...@tajo.ucsd.eduwrote: On Tue, 15 Dec 2009, Jean-Christophe Domenge wrote: Dear R gurus, I'm looking for a way to expand a matrix to a data frame as detailed below: given a Matrix M

Re: [R] Reshape a data set

2009-12-16 Thread Henrique Dallazuanna
Try this also: reshape(test, direction = 'wide', idvar = 'subject', timevar = 'coder') On Sun, Dec 13, 2009 at 6:04 PM, dadrivr dadr...@gmail.com wrote: I am trying to reshape a data set.  Could someone please help me with the reshape, cast, and melt functions?  I am new to R and I have tried

[R] R very large files

2009-12-16 Thread Albert-Jan Roskam
Hi,   I very recently started using R (as in: last week) and I was wondering if anyone could point me to website(s) with sample code to deal with large datasets (length- and/or breadthwise). I understood that R was never designed to work with datasets larger than, say, a couple of hundred Mb.

Re: [R] R very large files

2009-12-16 Thread S Devriese
On 12/16/2009 11:59 AM, Albert-Jan Roskam wrote: Hi, I very recently started using R (as in: last week) and I was wondering if anyone could point me to website(s) with sample code to deal with large datasets (length- and/or breadthwise). I understood that R was never designed to work

Re: [R] R very large files

2009-12-16 Thread Søren Højsgaard
The sqldf package may be of help to you. Regards Søren -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af Albert-Jan Roskam Sendt: 16. december 2009 11:59 Til: r-help@r-project.org Emne: [R] R very large files Hi,   I very

Re: [R] R very large files

2009-12-16 Thread Paul Hiemstra
Albert-Jan Roskam wrote: Hi, I very recently started using R (as in: last week) and I was wondering if anyone could point me to website(s) with sample code to deal with large datasets (length- and/or breadthwise). I understood that R was never designed to work with datasets larger than, say, a

Re: [R] Read dataset in R language

2009-12-16 Thread Millo Giovanni
Hello. This is to get you started with data.frames, next time please - read the posting guide - see the documentation, especially the builtin R data import/export manual form the help menu ## begin R examples, paste into console ## data(mtcars) # builtin database class(mtcars) # what it is

Re: [R] Read dataset in R language.

2009-12-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.12.2009 11:26:03: Hi all, I tried many things to read any dataset but I receive different error messages every time. One new message is: vector size specified is too large Can any one please send any part from any dataset just for testing

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Duncan Murdoch
On 16/12/2009 12:39 AM, Xiang Wu wrote: Is there a function in R that could find the significant digit of a specific number? Such as for 3.1415, return '5'? The question may not have an unambiguous answer: I would say 1.00 and 1.0 have a different number of significant digits, but once

Re: [R] Stata files

2009-12-16 Thread JRG
On 16 Dec 2009 at 10:24, Prof Brian Ripley wrote: Have you tried read.dta? The URL on the help page for read.dta now says 'Stata 11 help for dta', but it seems to document the same format (114) as Stata 10 (see the value section). So in so far as Stata is telling us, it looks like

Re: [R] R very large files

2009-12-16 Thread Albert-Jan Roskam
Thank you all! I got very useful advice and I saw some nice solutions that even made me drool! ;-) Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess.

Re: [R] user-written splits in rpart

2009-12-16 Thread Terry Therneau
--- begin included message --- Hi, I am trying to write my own split function for rpart. The aim is to do, instead of anova, a linear regression to determine the split (minimize some criterion like sum of rss left and right of the split). The regression (lm) should simply use the dependent and

Re: [R] rcart - classification and regression trees (CART)

2009-12-16 Thread Frank E Harrell Jr
Katie N wrote: Hi, I am trying to use CART to find an ideal cut-off value for a simple diagnostic test (ie when the test score is above x, diagnose the condition). When I put in the model fit=rpart(outcome ~ predictor1(TB144), method=class, data=data8) sometimes it gives me a tree with

Re: [R] Changing Column names in (Output) csv file

2009-12-16 Thread Nikhil Kaza
I am not sure why you are reading and writing from disk so many times? It will degrade performance. Also avoid loops when you can. just use ONS$labels - paste(ONS$Var1[i], ONS$Var2[i], ONS$Var3[i], ONS $Var4[i], ONS$Var5[i], ONS$Var6[i], ONS$Var7[i], ONS$Var8[i],ONS $Var9[i],

Re: [R] How to find the significant digits of a number?

2009-12-16 Thread Duncan Murdoch
On 16/12/2009 8:48 AM, Xiang Wu wrote: Yes, that's true. But what I need is the original precision of a numeric. So to me, 1.00 and 1. are different. In that case, they are not numbers, but strings: and you can probably use nchar() to count characters, after stripping off any leading or

Re: [R] rcart - classification and regression trees (CART)

2009-12-16 Thread Terry Therneau
Is there a way to tell it to make a tree with only one node? - see the maxdepth parameter in ?rpart.control Is it safe to assume that the cut-off value on the primary node is the ideal cut-off? - trees are built sequentially; the first split will be the same for a tree with only one split or

Re: [R] Structural Equation Models(SEM)

2009-12-16 Thread John Fox
Dear Jarrett et al., I apologize for missing Ralf Finne's original posting -- I was out of town at the time. A few comments on this code: (1) You should be able to get standard errors from the GLS solution (though there's a missing factor 0.5 in the definition of objective.2 that should deflate

Re: [R] R and Hierarchical Forecasting

2009-12-16 Thread Kjetil Halvorsen
I don't know of any prepackaged functions to do this, but I have done this with some success, using compositional methods: forecasting the total, and then forecasting the compositions.,, with compositional data analysis. The package compositions or robCompositions might be usefull. Or not. Kjetil

[R] Creating Dummy Variables in R

2009-12-16 Thread whitaker m. (mw1006)
Hi, I am trying to create a set of dummy variables to use within a multiple linear regression and am unable to find the codes within the manuals. For example i have: Price Weight Clarity IF VVS1VVS2 5008 1 0 0

[R] difference between the meaning of MARGIN in sweep() and apply()

2009-12-16 Thread Levi Waldron
For example, subtracting 1:2 from the rows of a two-column matrix: t(apply(matrix(1:6,ncol=2),MARGIN=1,function(y) y - 1:2)) [,1] [,2] [1,]02 [2,]13 [3,]24 sweep(matrix(1:6,ncol=2),MARGIN=2,1:2,FUN=-) [,1] [,2] [1,]02 [2,]13 [3,]24 Is

[R] Odp: Creating Dummy Variables in R

2009-12-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.12.2009 15:58:56: Hi, I am trying to create a set of dummy variables to use within a multiple linear regression and am unable to find the codes within the manuals. For example i have: Price Weight Clarity

Re: [R] Creating Dummy Variables in R

2009-12-16 Thread S Devriese
On 12/16/2009 03:58 PM, whitaker m. (mw1006) wrote: Hi, I am trying to create a set of dummy variables to use within a multiple linear regression and am unable to find the codes within the manuals. For example i have: Price Weight Clarity IF VVS1

Re: [R] Creating Dummy Variables in R

2009-12-16 Thread Achim Zeileis
On Wed, 16 Dec 2009, whitaker m. (mw1006) wrote: Hi, I am trying to create a set of dummy variables to use within a multiple linear regression and am unable to find the codes within the manuals. For example i have: Price Weight Clarity IF VVS1VVS2

Re: [R] Odp: Creating Dummy Variables in R

2009-12-16 Thread Nikhil Kaza
I don't think R will complain, if you use the approach below. However, IF, VVS1 and VVS2 are linearly dependent. Better use the factor approach and define which factor should be the contrast Nikhil On 16 Dec 2009, at 10:12AM, Petr PIKAL wrote: what commands did you use for regression I

Re: [R] Creating Dummy Variables in R

2009-12-16 Thread Tom Fletcher
Is your variable Clarity a categorical with 4 levels? Thus, the need for k-1 (3) dummies? Your error may be the result of creating k instead of k-1 dummies, but can't be sure from the example. In R, you don't have to (unless you really want to) explicitly create separate variables. You can use

[R] Duration model with sample selection (or selectivity)

2009-12-16 Thread Changyou Sun
Hello All, I am interested in estimating a duration model (also known as survival analysis or event-history analysis). I use an economic dataset. In economics terms, the model is duration model with sample selection (or selectivity). The time spell variable is only observed for a sample that

[R] Rgraphviz installation

2009-12-16 Thread Paul Evans
Hi, I wanted to install Rgraphviz. From the R GUI, I downloaded the package but when I tried to load it I got the following error message: This application has failed to start because libcdt-4.dll was not found. Re-installing the application may fix this problem. The R commands and errors are:

Re: [R] Rgraphviz installation

2009-12-16 Thread Martin Morgan
Hi Paul Rgraphviz is a bioconductor package, so ask on the Bioconductor mailing list. http://bioconductor.org/docs/mailList.html Install Bioconductor packages following the instructions here http://bioconductor.org/docs/install/ Rgraphviz on Windows installed from binary (as you're doing

[R] Baseline survival estimate

2009-12-16 Thread Laura Bonnett
Dear R-help, I am trying to obtain the baseline survival estimate of a fitted Cox model (S_0 (t)). I know that previous posts have said use 'basehaz' but this gives the baseline hazard function and not the baseline survival estimate. Is there a way to obtain the baseline survival estimate or do

Re: [R] Baseline survival estimate

2009-12-16 Thread tlumley
survival = exp(-hazard) -thomas On Wed, 16 Dec 2009, Laura Bonnett wrote: Dear R-help, I am trying to obtain the baseline survival estimate of a fitted Cox model (S_0 (t)). I know that previous posts have said use 'basehaz' but this gives the baseline hazard function and not the

Re: [R] Baseline survival estimate

2009-12-16 Thread Marc Schwartz
I might just extend Thomas' succinct reply with a pointer to ? survfit.coxph in the 'survival' package, which will provide the baseline survival estimates at the mean values of the covariates from the Cox model. It also has nice summary and plot methods and allows for estimating predicted

Re: [R] difference between the meaning of MARGIN in sweep() and apply()

2009-12-16 Thread Charles C. Berry
On Wed, 16 Dec 2009, Levi Waldron wrote: For example, subtracting 1:2 from the rows of a two-column matrix: t(apply(matrix(1:6,ncol=2),MARGIN=1,function(y) y - 1:2)) [,1] [,2] [1,]02 [2,]13 [3,]24 sweep(matrix(1:6,ncol=2),MARGIN=2,1:2,FUN=-) [,1] [,2] [1,]

[R] problem with a densityplot

2009-12-16 Thread c...@autistici.org
Hi, i have a script how i launch lattice to make a densityplot. in the script: jpeg(file=XXX.jpg) densityplot(~f_diametro+m_diametro+n_diametro, plot.points=rug, auto.key=T) dev.off() does'nt work and in R i dont have any output but if i launch by R row by row, runs correctly. any idea?

Re: [R] problem with a densityplot

2009-12-16 Thread baptiste auguie
FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f you need to print() HTH, baptiste 2009/12/16 c...@autistici.org c...@autistici.org: Hi, i have a script how i launch lattice to make a densityplot. in the script: jpeg(file=XXX.jpg)

Re: [R] problem with a densityplot

2009-12-16 Thread Benilton Carvalho
instead of densityplot(...) use print(densityplot(...)) b On Dec 16, 2009, at 3:19 PM, c...@autistici.org wrote: Hi, i have a script how i launch lattice to make a densityplot. in the script: jpeg(file=XXX.jpg) densityplot(~f_diametro+m_diametro+n_diametro, plot.points=rug, auto.key=T)

[R] fortune-like FAQ search

2009-12-16 Thread baptiste auguie
Dear list, I'm not so familiar with the internals of the fortunes package, but I really like the interface. I was wondering if someone had implemented a similar functionality to parse the entries of the R FAQ http://cran.r-project.org/doc/FAQ/R-FAQ.html . Say, if I was to answer a question Why

[R] number of observations used in cor when use=pairwise.obs

2009-12-16 Thread Jean-Christophe Domenge
Dear R gurus, to compute the correlation matrix of n variables with n_obs observations each, possibly including NA, I use cor(M, use=pairwise.obs) where m is a n x nobs matrix. Now I want to know the number of observations actually used in this computation, namely for each pair of columns in M,

Re: [R] write.csv and header

2009-12-16 Thread Patrick Connolly
On Tue, 15-Dec-2009 at 01:55PM +0100, Gustaf Rydevik wrote: | Hi, | | ?write.table and the argument append should be of help. | example: | | sink(test.csv) | cat(-) | cat(\n) | cat(This is \n a test of header) | cat(\n) | cat(-) |

Re: [R] number of observations used in cor when use=pairwise.obs

2009-12-16 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jean-Christophe Domenge Sent: Wednesday, December 16, 2009 11:48 AM To: r-help Subject: [R] number of observations used in cor when use=pairwise.obs Dear R gurus, to

Re: [R] number of observations used in cor when use=pairwise.obs

2009-12-16 Thread Jean-Christophe Domenge
great, thanks! jc On Wed, Dec 16, 2009 at 20:55, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jean-Christophe Domenge Sent: Wednesday, December 16, 2009 11:48 AM To: r-help

Re: [R] write.csv and header

2009-12-16 Thread rkevinburton
I have a small request regarding this append feature. As it is now if the data is appended to the file so is the header. I would like to have the header only entered once and appends just append the data. Doable? Kevin Patrick Connolly p_conno...@slingshot.co.nz wrote: On Tue,

Re: [R] write.csv and header

2009-12-16 Thread rkevinburton
I have a small request regarding this append feature. As it is now if the data is appended to the file so is the header. I would like to have the header only entered once and appends just append the data. Doable? Kevin Patrick Connolly p_conno...@slingshot.co.nz wrote: On Tue,

Re: [R] memory problem on Suse

2009-12-16 Thread Ambrosi Alessandro
Dear all and dear Marc, it seems you hit the target. I checked as you suggested, and... it is a 32 bit version! Now I'm fixing it. Thank you very much. Alessandro From: Marc Schwartz [marc_schwa...@me.com] Sent: 11 December 2009 17:02 To: Ambrosi

Re: [R] Rgraphviz install

2009-12-16 Thread Costa
Hi, I installed R.10.1 and Graphviz 2.26 - which doesnt contain the libcdt-4.dll, so I get the same error message 'This application has failed to start because libcdt-4.dll was not found' when loading in R library (Rgraphviz) I cannot find an installation file for Graphviz 2.20 to use under

[R] WinBUGS - R2WinBUGS problem

2009-12-16 Thread Sotiris Adamakis
Appologies for cross-posting Dear R users, I am using R2WinBUGS to call WinBUGS from R. After loading data, model, and initial values I call this command res - bugs(data = dfile, inits = list(ifile), parameters.to.save = c(beta), model.file = mfile, working.directory = tdir, n.thin =

[R] regularised incomplete beta function

2009-12-16 Thread Xin Shi
Dear: I am trying to work out the regularised incomplete beta function in R. I searched google on this and found UCS library. But I can not find this in R packages. Does anyone have use this before or how to insert UCS in R? Many Thanks! Xin Xin --- Dr.Xin Shi Senior Lecturer in

Re: [R] regularised incomplete beta function

2009-12-16 Thread Ravi Varadhan
?pbeta --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410) 614-9625 Email:

[R] henon map

2009-12-16 Thread x y
Hi, I would plot a Henon map: plot(henon(start=rnorm(2), a=1.4, b=0.3, n.sample=2000, n.transient=10),pch=.,cex=0.1) but give me some errors: Error in henon(start = rnorm(2), a = 1.4, b = 0.3, n.sample = 2000, n.transient = 10) : could not find function checkVectorType Error in

[R] What is the fastest way to see what are in an RData file?

2009-12-16 Thread Peng Yu
Currently, I load the RData file then ls() and str(). But loading the file takes too long if the file is big. Most of the time, I only interested what the variables are in the the file and the attributes of the variables (like if it is a data.frame, matrix, what are the colnames/rownames, etc.)

Re: [R] Odp: Creating Dummy Variables in R

2009-12-16 Thread whitaker m. (mw1006)
I have a much larger dataset than in my original email (attached - price dependent upon weight, Clarity (different levels IF-SI2), colour(levels D-L) and Cut (ideal-fair), and tried the regression command:

Re: [R] regularised incomplete beta function

2009-12-16 Thread Stefan Evert
On 16 Dec 2009, at 21:40, Ravi Varadhan wrote: ?pbeta And the zipfR package wraps these in terms of the usual terminology for incomplete/regularised upper/lower Beta functions (see ?Rbeta there), for people like me who can't get their head around the equivalence between the Beta

Re: [R] Odp: Creating Dummy Variables in R

2009-12-16 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of whitaker m. (mw1006) Sent: Wednesday, December 16, 2009 2:14 PM To: Nikhil Kaza; Petr PIKAL Cc: r-help@r-project.org Subject: Re: [R] Odp: Creating Dummy Variables in R I have

Re: [R] write.csv and header

2009-12-16 Thread John Kane
Just write the headers once and append as many times as needed? You can append as many datasets as you want. --- On Wed, 12/16/09, rkevinbur...@charter.net rkevinbur...@charter.net wrote: From: rkevinbur...@charter.net rkevinbur...@charter.net Subject: Re: [R] write.csv and header To:

Re: [R] Odp: Creating Dummy Variables in R

2009-12-16 Thread Peter Dalgaard
Nordlund, Dan (DSHS/RDA) wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of whitaker m. (mw1006) Sent: Wednesday, December 16, 2009 2:14 PM To: Nikhil Kaza; Petr PIKAL Cc: r-help@r-project.org Subject: Re: [R] Odp: Creating

Re: [R] Odp: Creating Dummy Variables in R

2009-12-16 Thread Rolf Turner
On 17/12/2009, at 11:14 AM, whitaker m. (mw1006) wrote: I have a much larger dataset than in my original email (attached - price dependent upon weight, Clarity (different levels IF-SI2), colour(levels D-L) and Cut (ideal-fair), and tried the regression command:

Re: [R] Stata files

2009-12-16 Thread David Scott
Thank you both (JRG and BDR) for the advice. Just to clarify Brian, I don't actually have any example .dta files yet to test. I wanted to be prepared and be able to advise the client what to do. I don't see anything about 'Stata 11 help for dta' Brian: must have a different URL. But I did

[R] Error for making packages under windows XP-Error in library.dynam(lib, package, package.lib)

2009-12-16 Thread rusers.sh
Hi, I have installed the necessary tools for making a R package under windows and am sure these tool have been correctly configured. I am very new to try writing a package, so the error may be very obvious for you. Forgive me if it is too easy. My package name is *stam*, and i put it under the

[R] change the scale of grid lines in a plot

2009-12-16 Thread Roslina Zakaria
Hi,   I would like to change a scale of the grid lines in a plot.  I can see the default is 0.2, so how do I change to 0.1?   Thank you so much for any help given. [[alternative HTML version deleted]] __ R-help@r-project.org mailing

[R] Remove duplicates from a data frame but with some special requirements

2009-12-16 Thread gcam
Hi all. So I have a data frame with multiple columns/variables. The first variable is a major sample name for which there are some sub-samples. Currently I have used the following command to remove the duplicates: Samps_working-Samps[-c(which(duplicated(Samps$ESR_Ref_edit))),] This removes

Re: [R] Remove duplicates from a data frame but with some special requirements

2009-12-16 Thread Gray Calhoun
Hi, Try: subset(Samps, !duplicated(Samps$ESR_ref_edit) | Samps$Loaded == Y) I'd need specific code to be sure that this is exactly what you want (ie you specify input and desired output), but indexing with a logical vector is probably going to be the solution. Best, Gray On Wed, Dec 16, 2009

[R] Help with Merge - unexpected loss of factor level

2009-12-16 Thread Zoe van Havre
Hi, Thanks in advance for any advice you can give me, I am very stumped on this problem... I use R every day and consider myself a confident user, but this seems to be an elementary problem.. Outline of problem: I am analysing the results of a study on protein expression in cancer tissues. I

Re: [R] change the scale of grid lines in a plot

2009-12-16 Thread Jim Lemon
On 12/17/2009 02:22 PM, Roslina Zakaria wrote: Hi, I would like to change a scale of the grid lines in a plot. I can see the default is 0.2, so how do I change to 0.1? Hi Roslina, This depends very much on the plot you are using. grid, which will add grid lines to a base graphics

[R] Random Number Generation in a Loop

2009-12-16 Thread Maithili Shiva
Dear R helpers   I am having following data   Name   Numbers A  25 B   3  C  13 A   5  B   7 C   0 A   2 B 10 C   9   CONDITIONS   If Name is

[R] CORRECTION - Generation of Random numbers in a loop

2009-12-16 Thread Maithili Shiva
Dear R helpers, please ignore my earlier mail. Here is the corrected mail. Please forgive me for the lapses on my part. Extremely sorry.   Here is the corrected mail.     Dear R helpers   I am having following data   Name   Numbers A11  12 A12  17  A13 

Re: [R] Help with Merge - unexpected loss of factor level

2009-12-16 Thread Patrick Connolly
On Thu, 17-Dec-2009 at 03:17PM +1000, Zoe van Havre wrote: [...] | The problem is that I have been tracking one factor in particular | ('branch', values 2 or 3) and once the final merge occurs, the | second level of this factor seems to disappear in the last dataset, | even though it was present

Re: [R] Random Number Generation in a Loop

2009-12-16 Thread Daniel Malter
Hi, does this do what you want to do? I take the first six lines of the data you provided. Note that letters corresponds to your Name, and number corresponds to your Numbers variable. letters=rep(c(A,B,C),2) letters number=c(25,3,13,5,7,0) number letters2=rep(letters,number) letters2