[R] convert strings to object names: SUMMARY

2012-05-04 Thread Denis Kazakiewicz
Hello to R people This is not a question. Just found a beautiful summary dated back in 2004. Hope this will be useful for your work Thanks to Gudrun Jonasdottir mailto:gudrunj_at_math.su.se?Subject=Re:%20[R]%20convert%20strings%20to%20object%20names:%20SUMMARY>> In summary: The quickest way to co

Re: [R] Finding all rows of a matrix equal to vector

2011-07-16 Thread Denis Kazakiewicz
Hi a bit ugly approach but it works x1<-c(1,2,3) x2<-c(1,5,6) x3<-c(7,8,9) A<-matrix(c(rep(x1,5),rep(x2,5),rep(x3,5),rep(x1,5)),nrow=20,ncol=3,byrow=T) A B <- apply(A,1, FUN = function(x)paste(x, collapse = '')) table(B) On 16.07.2011 12:29, Sebastian Lerch wrote: Hi everyone, my question mi

Re: [R] Querying RData Files, SQL style?

2011-07-15 Thread Denis Kazakiewicz
http://cran.r-project.org/web/packages/RMySQL/ On 15.07.2011 17:29, Bhushan, Vipul wrote: Hello. Is there a package or functionality available somewhere which will allow for complex searches (such as what SQL can do) of collections of RData files? Search capability within a given RData file at

[R] total offtopic

2011-07-13 Thread Denis Kazakiewicz
Hello everybody Forget about 13th Take it easy __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Error when writing to Excel files using the packages xlsx and xlsx2

2011-07-13 Thread Denis Kazakiewicz
write.csv(mydata, file="mydataExported.csv", na="") On 13.07.2011 12:46, syrvn wrote: Dear group, I am working on a rather big project where the output data frames have dimensions of 3000 x 15 or greater. We are using xlsx and xlsx2 to write the data.frames to Excel sheets. Since recently we

Re: [R] Error when writing to Excel files using the packages xlsx and xlsx2

2011-07-13 Thread Denis Kazakiewicz
The most safe way work with excel is through .csv format Sorry for being nonspecific On 13.07.2011 12:46, syrvn wrote: Dear group, I am working on a rather big project where the output data frames have dimensions of 3000 x 15 or greater. We are using xlsx and xlsx2 to write the data.frames to E

[R] How to remove last 3 letters

2011-07-13 Thread Denis Kazakiewicz
Hello to everybody I have vector of drug dosage in string format 1.5 mg , 50 mg , 100 mg , 0.5 mg ... The task is to remove last free symbols: ' mg' Any suggestions are highly appreciated __ R-help@r-project.org mailing list https://stat.ethz.ch/mailm

Re: [R] Setting up list of many equations for systemfit

2011-06-21 Thread Denis Kazakiewicz
Why don't try as.formula() function On 22.06.2011 01:22, Rita Carreira wrote: Dear List Members,I am trying to set up a large system of equations and I am trying to find a simple way to set up the list command under the package system fit. Here is the example from system fit and what I am try

Re: [R] converting character to numeric

2011-06-21 Thread Denis Kazakiewicz
IMHO: 'as.numeric(as.character' is very reasonable suggestion On 22.06.2011 01:16, bill.venab...@csiro.au wrote: ..or something like that. Without more details it is hard to know just what is going on. Firstly in R the object is a 'data frame' (or object of class "data.frame" to be formal).

Re: [R] converting character to numeric

2011-06-21 Thread Denis Kazakiewicz
Hi Sorry, can't answer your question However, I had exactly the same problem and just came back to my spreadsheet redactor and changed the format of cells Denis I'm trying to convert data from character to numeric. I've imported data as a csv file, I'm assuming that the import is a database

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
This should work also data.frame(ls()) rm(list=ls()[-5]) #for instance On 13.04.2011 01:45, Rolf Turner wrote: > On 13/04/11 09:49, Denis Kazakiewicz wrote: >> On 13.04.2011 00:39, Jim Silverton wrote: >>> How do I remove all objects except one in R? >>> >&g

Re: [R] Removing objects and clearing memory

2011-04-12 Thread Denis Kazakiewicz
On 13.04.2011 00:39, Jim Silverton wrote: How do I remove all objects except one in R? rm(list=ls()) #will remove ALL objects __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

Re: [R] export data to gnuplot

2011-03-27 Thread Denis Kazakiewicz
Dear Petr Thank you very much У Няд, 27/03/2011 у 22:23 +0200, Petr Savicky піша: > On Sun, Mar 27, 2011 at 10:12:38PM +0300, Denis Kazakiewicz wrote: > > Hello > > > > How to export data frame to file which can be used by gnuplot? > > Hello: > > Try the follo

[R] export data to gnuplot

2011-03-27 Thread Denis Kazakiewicz
Hello How to export data frame to file which can be used by gnuplot? P.S. Sorry for naive question __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide

Re: [R] two plots in qplot

2011-03-25 Thread Denis Kazakiewicz
ta > > On Fri, Mar 25, 2011 at 1:24 AM, Denis Kazakiewicz > wrote: > > Hello > > I simply want to plot two variables against one 'year' variable in > > qplot. > > Is any way of doing this without reshaping data in long format a

[R] two plots in qplot

2011-03-25 Thread Denis Kazakiewicz
Hello I simply want to plot two variables against one 'year' variable in qplot. Is any way of doing this without reshaping data in long format and using facet function afterwards? Thank you Denis __ R-help@r-project.org mailing list https://stat.ethz.c

[R] two plots in qplot

2011-03-25 Thread Denis Kazakiewicz
Hello I simply want to plot two variables against one 'year' variable in qplot. Is any way of doing this without reshaping data in long format and using facet function afterwards? Thank you Denis __ R-help@r-project.org mailing list https://stat.ethz.c

[R] two plots in qplot

2011-03-24 Thread Denis Kazakiewicz
Hello I simply want to plot two variables against one 'year' variable in qplot. Is any way of doing this without reshaping data in long format and using facet function afterwards? Thank you Denis __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Cut off end of string [and some chemotherapy staff]

2011-03-12 Thread Denis Kazakiewicz
У Срд, 09/03/2011 у 23:29 -0800, Dennis Murphy піша: > Hi: > > Here's one approach, although I imagine there are more efficient ways. > > # A function to strip spaces and return the first three non-blank elements > of a string > keyset <- function(x) substr(gsub(' ', '', x)[1], 1, 3) Hello to ev

[R] String manipulation

2011-03-08 Thread Denis Kazakiewicz
Dear [R] people Could you please help with following How to convert a vector 'ac','ac','c','ac','ac','c' into a single string 'ac2_c_ac2_c' Thank you in advance __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

Re: [R] accuracy of measurements

2011-02-25 Thread Denis Kazakiewicz
Dennis > > On Fri, Feb 25, 2011 at 5:39 AM, Marc Schwartz > wrote: > On Feb 24, 2011, at 4:50 PM, Denis Kazakiewicz wrote: > > > Dear R people > > Could you please help with following > > > >

[R] accuracy of measurements

2011-02-24 Thread Denis Kazakiewicz
Dear R people Could you please help with following Trying to compare accuracy of tumor size evaluation by different methods. So data looks like id true metod1 method2 ... 1 22 2.5 2 1.5 2 2 3 22 2 etc. Could you please give a hint how to deal with that. Seems like

Re: [R] Just another pattern matching / indexing question

2011-02-08 Thread Denis Kazakiewicz
For the sake of simplicity I've made your data example idd d1 d2 d3 d4 1 a d b c 2 a d v h 3 c b v NA 4 q v NA f df <- read.table('clipboard', header = TRUE,na.strings="NA") df

Re: [R] which multivariate regression?

2011-02-08 Thread Denis Kazakiewicz
Dear Andrew Halford Here just merely a suggestion of R newbie without sufficient statistical background MCMCpoisson from package MCMCpack Could you please lately post the answer to your very interesting question when you will find it. Wit best regards Denis У Аўт, 08/02/2011 у 14:38

Re: [R] aggregate function - na.action

2011-02-06 Thread Denis Kazakiewicz
Try to use formula notation and use na.action=na.pass It is all described in the help(aggregate) У Няд, 06/02/2011 у 14:54 -0600, Gene Leynes піша: > On Fri, Feb 4, 2011 at 6:54 PM, Ista Zahn wrote: > > > > > > > However, I don't think you've told us what you're actually trying to > > > accompl

Re: [R] exact logistic regression

2011-02-05 Thread Denis Kazakiewicz
Dear Łukas Thank you very much ...FOR EACH ROW... That's cool data2elrm<-cbind(mydata,n=1) With best regards Denis У Пят, 04/02/2011 у 22:16 +0100, Łukasz Ręcławowicz піша: > > > 2011/2/4 Den > To use elrm() I have to aggregate my data,which is really time > consuming >

Re: [R] exact logistic regression

2011-02-05 Thread Denis Kazakiewicz
Dear Brad Dear Jinko Dear David Sorry for the noise out of nothing. It was because of my ignorance and misunderstanding of algorithms of elrm. elrm is great for the assessment of multivariable model where Stata simply runs out of memory fails, while Stata can make exact calculations on one variab

Re: [R] exact logistic regression

2011-02-04 Thread Denis Kazakiewicz
Dear Łukasz Thank you very much for information Dear R people could you please help please with following questions Sorry for my silly questions, because I am not a mathematician. 1. Is elrm() works similar as exact regression in SAS or Stata? After double check in Stata and R some results from m

Re: [R] recode according to specific sequence of characters within a string variable

2011-02-04 Thread Denis Kazakiewicz
Dear R people Could you please help I have similar but opposite question How to reshape data from DF.new to DF from example, Mark kindly provided? Thank you Denis On Пят, 2011-02-04 at 07:09 -0600, Marc Schwartz wrote: > On Feb 4, 2011, at 6:32 AM, D. Alain wrote: > > > Dear R-List, > > > >

[R] pharmacoepidemiology

2011-01-22 Thread Denis Kazakiewicz
Hi to all R community Does anybody know good R packages/books dedicated to efficient usage of R in pharmacoepidemiological research? Thank you in advance -- Denis Kazakiewicz __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] count id by id

2011-01-18 Thread Denis Kazakiewicz
Hi Trying to work out that: Each person can take from 1 to 9 drugs. And data frame looks like id drug 1 d 2 g 2 d 2 r 3 e 3 a ... Q: How many drugs one person takes on average? Thank you __ R-help@r