[R] How to use compare.linkage in RecordLinkage package? -- more details but problem remains

2016-01-28 Thread Anders Alexandersson
How does one link two datasets using the compare.linkage function in the RecordLinkage package? This is to follow-up on my original posting earlier today: https://stat.ethz.ch/pipermail/r-help/2016-January/435736.html I suggested then that I should perhaps have added the identity argument. But if

Re: [R] How to use the options "usecommand" and "command" of tktable?

2015-12-18 Thread Cleber Borges
# only a update the R code (with strange behavior) library( tcltk ); tclRequire( "Tktable" ) top <- tktoplevel() tcl('variable', 'myarray') tcl('array', 'unset', 'myarray') x <- 0 tabCmd <- function() { x <<- x + 1 return( as.tclObj( paste(x) ) ) } tab <- tkwidget( top, 'table', rows=2,

[R] How to use the options "usecommand" and "command" of tktable?

2015-12-17 Thread Cleber N.Borges
How to capture the output from the "command" option of tktable and how to send input to it? As far as I understand, the most appropriate way to use the tktable is through the flag usecommand and command. It fires the string information and cell coordinates and wait for a new string to set a

Re: [R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Giorgio Garziano
You may use the "caret" package. At the following link 2-classes and 3-classes examples: http://www.inside-r.org/node/86995 -- GG [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Hamed Nofal
Dear Colleagues I need someone to kindly help me solving this problem. A sample of 89 patients was tested for 4 tumor types (T1, T2, T3, T4). The results of the operative predicted T stage and those of the pathology tests are tabulated in the following table:

Re: [R] how to use confusionMatrix function in solving multi-classes problem

2015-12-13 Thread Boris Steipe
This looks like homework to me and this list has a No-Homework policy. Now, once you have done your homework (and that includes reading the documentation of the functions you are using), and you are still confused about details, you are welcome to ask again. Please keep the following in mind:

[R] How to use curve() with two parameters in the function

2015-10-27 Thread C W
Dear R list, I am trying to plot the curve of a function. Here's the R code: library(mvtnorm) p <- function(x, mu){ mu <- c(mu, 0) dmvnorm(c(x, 1), mu, diag(2)) } > curve(p(x, 2), from = 0, to =1) Error in dmvnorm(c(x, 1), mu, diag(2)) : mean and sigma have non-conforming size I

Re: [R] How to use curve() with two parameters in the function

2015-10-27 Thread C W
Never mind, I figured it out. You need to use sapply(), for instance, curve(sapply(x, p), from = 0, to =10) Thanks all! On Tue, Oct 27, 2015 at 11:14 AM, C W wrote: > Dear R list, > > I am trying to plot the curve of a function. > > Here's the R code: > > library(mvtnorm) >

[R] How to use dwish in MCMCpack in R

2015-09-03 Thread Anamika Chaudhuri
Hi All: I am trying to use the dwish function in the MCMCpack in R dwish(W, v, S) where Arguments W-Positive definite matrix W v-Degrees of freedom (scalar). S-Inverse scale matrix How do I determine W, the positive definite matrix. The matrix provided in the documentation doesnot help.

Re: [R] How to use dwish in MCMCpack in R

2015-09-03 Thread Anamika Chaudhuri
I put in the matrix at which I want the density as S. I was wondering what is W then? Thanks Anamika On Thu, Sep 3, 2015 at 12:28 PM, Duncan Murdoch wrote: > On 03/09/2015 9:29 AM, Anamika Chaudhuri wrote: > > Hi All: > > > > I am trying to use the dwish function in

Re: [R] How to use dwish in MCMCpack in R

2015-09-03 Thread Duncan Murdoch
On 03/09/2015 9:29 AM, Anamika Chaudhuri wrote: > Hi All: > > I am trying to use the dwish function in the MCMCpack in R > > dwish(W, v, S) where > > Arguments > W-Positive definite matrix W > v-Degrees of freedom (scalar). > S-Inverse scale matrix > > How do I determine W, the positive

Re: [R] How to use dwish in MCMCpack in R

2015-09-03 Thread Duncan Murdoch
On 03/09/2015 12:41 PM, Anamika Chaudhuri wrote: > I put in the matrix at which I want the density as S. I was wondering > what is W then? You need to read the help page. The matrix at which you want the density is W. S is a parameter of the distribution. Duncan Murdoch > > Thanks > Anamika

[R] how to use nlme package to analysis mixed effect model

2015-08-04 Thread PO SU
Dear experts,    i want to use nlme or plm to analysis mixed effect model, my data has the format :   city  year  area    y   x       1    2010   A     1.2   2    1    2011   A     3    3     2   2010   A     5    4     2   2011   A    2.1   1.8    3  2010  B      1.7    2       I

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-31 Thread Ben Tupper
Hi Philippe, Ah! Thanks for pointing out the pesky ifelse() issue. I have only recently been learning (the hard way) that ifelse() is not a tool for the uninformed like me, but it is ever so tempting! I would like to offer another way to speed things up. findInterval() can be quite fast,

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-31 Thread Philippe Grosjean
Also note that ifelse() should be avoided as much as possible. To define a piecewise function you can use this trick: func - function (x, min, max) 1/(max-min) * (x = min x = max) The performances are much better. This has no impact here, but it is a good habit to take in case you manipulate

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-31 Thread peter dalgaard
On 31 Jan 2015, at 09:39 , Rolf Turner r.tur...@auckland.ac.nz wrote: On 31/01/15 21:10, C W wrote: Hi Bill, One quick question. What if I wanted to use curve() for a uniform distribution? Say, unif(0.5, 1.3), 0 elsewhere. My R code: func - function(min, max){ 1 / (max - min)

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-31 Thread C W
Hi Bill, One quick question. What if I wanted to use curve() for a uniform distribution? Say, unif(0.5, 1.3), 0 elsewhere. My R code: func - function(min, max){ 1 / (max - min) } curve(func(min = 0.5, max = 1.3), from = 0, to = 2) curve() wants an expression, but I have a constant. And I

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-31 Thread Rolf Turner
On 31/01/15 21:10, C W wrote: Hi Bill, One quick question. What if I wanted to use curve() for a uniform distribution? Say, unif(0.5, 1.3), 0 elsewhere. My R code: func - function(min, max){ 1 / (max - min) } curve(func(min = 0.5, max = 1.3), from = 0, to = 2) curve() wants an

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-29 Thread Rui Barradas
Hello, The following will work, but I don't know if it's what you want. func2 will get x and y from the global environment. func2 - function(mu){ x + y + mu ^ 2 } curve(func2, from = 0, to = 10) Hope this helps, Rui Barradas Em 29-01-2015 21:02, C W escreveu: Hi all, I want to graph

[R] How to use curve() function without using x as the variable name inside expression?

2015-01-29 Thread C W
Hi all, I want to graph a curve as a function of mu, not x. Here's the R code: x - rnorm(10) y - rnorm(10) func - function(x, y, mu){ x + y + mu ^ 2 } curve(f = func(x = x, y = y, mu), from = 0, to = 10) I know I can change variable mu to x, but is there a way to tell R that mu is the

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-29 Thread C W
Hi Rui, Thank you for your help. That works for now, but eventually, I need to be pass in x and y. Is there a way to tell the curve() function, x is a fix vector, mu is a variable! Thanks, Mike On Thu, Jan 29, 2015 at 5:25 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, The following

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-29 Thread William Dunlap
Does help(curve) talk about its 'xname' argument? Try curve(10*foofoo, from=0, to=17, xname=foofoo) You will have to modify your function, since curve() will call it once with a long vector for the independent variable and func(rnorm(10), rnorm(10), mu=seq(0,5,len=501)) won't work right.

Re: [R] How to use curve() function without using x as the variable name inside expression?

2015-01-29 Thread C W
Hi Bill, You solved by problem. For some reason, I thought xname was only referring to name of the x-axis. I remember last time I fixed it, it was something about xname, couldn't get it right this time. Thanks! Saved me hours from frustration. Mike On Thu, Jan 29, 2015 at 9:04 PM, William

[R] How to use ggplot2

2014-11-26 Thread jarod...@libero.it
Dear All!! I'll try to plot a barplot using aggplot2 head(alt) as.factor.data...7..Col ColMat Fastq miseq 1 189158158158104 2 190 54272 54272 54272 32122 3 191 301574 301574 301574 152625 4 192 161620

Re: [R] How to use ggplot2

2014-11-26 Thread John Kane
(aa))) p1 - p1 + geom_bar(stat = identity) p1 John Kane Kingston ON Canada -Original Message- From: jarod...@libero.it Sent: Wed, 26 Nov 2014 18:04:21 +0100 (CET) To: r-help@r-project.org Subject: [R] How to use ggplot2 Dear All!! I'll try to plot a barplot using aggplot2

[R] how to use the rpart model to predict new data frame?

2014-11-11 Thread PO SU
Dear expeRts,     Now i have a  train  dataset a  and  test dataset b , i  using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp) but how can i use the trained model to predict b? TKS. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread David Winsemius
On Nov 11, 2014, at 7:47 PM, PO SU rhelpmaill...@163.com wrote: Dear expeRts, Now i have a train dataset a and test dataset b , i using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp) but how can i use the trained model to predict b? ?predict --

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread Bharat Bargujar
HI, Try this: results - predict(rp,b,type = vector) Regards, Bharat On 12 November 2014 09:17, PO SU rhelpmaill...@163.com wrote: Dear expeRts, Now i have a train dataset a and test dataset b , i using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp)

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread PO SU
OK , i tried predict(rp,b) but showed me a result which i can't understand, now it's the argument  type=vector worked. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-11-12 11:55:08, Bharat Bargujar bharatbargu...@gmail.com wrote: HI,   Try this:   results -

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-10 Thread PO SU
Tks for all your help,  finally i choose the way in Rstudio ctrl+shift+C, and do twice to cancel those comments. It's enough for me now. BTW, I also like the way: if(FALSE) {}   :) -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-09-10 02:15:49, Gjalt-Jorn

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread PO SU
I don't understand what's your meaning, do you mean that i should do some file processing,(like writing a script) ,so that i could add # in any line  i wanted. I think it is not convenient. And, it does seems that there is no way to multi line comment in R. But when i turn to using Rstudio,

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Berend Hasselman
On 09-09-2014, at 08:25, PO SU rhelpmaill...@163.com wrote: I don't understand what's your meaning, do you mean that i should do some file processing,(like writing a script) ,so that i could add # in any line i wanted. I think it is not convenient. And, it does seems that there is

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Pascal Oettli
No I don't mean this. Did you at least try the small example I provided? On Tue, Sep 9, 2014 at 3:25 PM, PO SU rhelpmaill...@163.com wrote: I don't understand what's your meaning, do you mean that i should do some file processing,(like writing a script) ,so that i could add # in any line i

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Duncan Murdoch
On 08/09/2014, 11:14 PM, Jeff Newmiller wrote: There are no multi line comment markers in R. However, since you are always referring to RStudio you might want to look into roxygen, since their editor supports that tool. RStudio has a command to comment a block: it's in the Code menu. (On

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Martin Maechler
PS == PO SU rhelpmaill...@163.com on Tue, 9 Sep 2014 10:49:32 +0800 writes: PS Dear expeRts,    I find it's terrible  when  i want to PS comment multi paragraph (e.g.  a 30 lines function) , i PS have to comment each line with #,  is there any good way PS to do that ?    I

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Bos, Roger
-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of PO SU Sent: Monday, September 08, 2014 10:50 PM To: R. Help Subject: [R] How to use multi paragraph comment like /* and */ in cpp? Dear expeRts, I find it's terrible when i want to comment multi paragraph (e.g

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Gjalt-Jorn Peters
In R-studio, you can also select whatever you want to comment out, and press CTRL-SHIFT-C to comment the selection in one go. To uncomment it all in one go again, you can select it again and press CTRL-SHIFT-C again. Gjalt-Jorn On 2014-09-09 5:51, Pascal Oettli wrote: A workaround is to

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-09 Thread Sven E. Templer
One way I know to do this is (in bash) to use a dummy variable and make the comment a multiline character string: dummy - c( This is my multiline comment or code block. ) or if printing does not disturb you, just use: ... Use ' if you have in the block. Other workarounds are here, which you

[R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-08 Thread PO SU
Dear expeRts,    I find it's terrible  when  i want to comment multi paragraph (e.g.  a 30 lines function) , i have to comment each line with #,  is there any good way to do that ?    I investgate it, but found no easy way, may you help me ? -- PO SU mail: desolato...@163.com Majored in

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-08 Thread Jeff Newmiller
There are no multi line comment markers in R. However, since you are always referring to RStudio you might want to look into roxygen, since their editor supports that tool. I would also suggest making more functions that are smaller.

Re: [R] How to use multi paragraph comment like /* and */ in cpp?

2014-09-08 Thread Pascal Oettli
A workaround is to escape the evaluation of the lines. For example: tt - 0 while(tt 0){ cat('rr\n') } Regards, Pascal On Tue, Sep 9, 2014 at 11:49 AM, PO SU rhelpmaill...@163.com wrote: Dear expeRts, I find it's terrible when i want to comment multi paragraph (e.g. a 30 lines

[R] How to use fixed parameter in mle2() function from bbmle package?

2014-06-08 Thread Marc Girondot
Dear list-members, I discover recently bbmle package from an answer in r-list. It makes some analyses more easily to solve. However I have one problem using fixed parameter of mle2 and one question about parametrization of mle2. I send the question directly to the maintainer of the package but

Re: [R] How to use rainbow function without the gamma argument

2014-04-20 Thread Francesco Brundu
Hi Boris, yes I tried this way and it worked. The fact is that I wanted to be compliant with the old code, I did not want to change anything. So I wanted to find a new way to rewrite the code. Thanks ~ Francesco Brundu On 19 April 2014 23:18, Boris Steipe boris.ste...@utoronto.ca wrote: Have

Re: [R] How to use rainbow function without the gamma argument

2014-04-20 Thread Francesco Brundu
Thanks Boris for the detailed answer. I thought to make it backward compatible because I did not know if gamma parameter would change the result if absent. As far as I can see changes in my results are not relevant, so I think to follow your advice to update the old code. Thanks ~ Francesco

[R] How to use rainbow function without the gamma argument

2014-04-19 Thread Francesco Brundu
Hi all, I am using an old code (probably written for R 2.5) and it stops when calling rainbow() with gamma argument. I saw that gamma argument is not present in newer version of R rainbow function. How can I translate this line of code: rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75,

Re: [R] How to use rainbow function without the gamma argument

2014-04-19 Thread Boris Steipe
Have you looked at ?rainbow ? Is there a reason why you don't simply leave the gamma parameter away? Try: pie(rep(1,100), col=rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75)) Cheers, B. On 2014-04-19, at 6:05 AM, Francesco Brundu wrote: Hi all, I am using an old code (probably

Re: [R] How to use rainbow function without the gamma argument

2014-04-19 Thread Boris Steipe
If it MUST be parameter-compatible with the old call, you could just add ... to your local version of rainbow. The unused parameter will then be dropped. Here's how: # The original creates an error ... rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5) Error in rainbow(100,

Re: [R] How to use an elements' name when creating a data frame via a for loop

2014-04-07 Thread arun
Hi, May be this helps: stations - LETTERS[1:4] set.seed(42) PM2.5 - data.frame(DateTime=seq(as.POSIXct(2010-01-10 01:00:00),length.out=10,by= 1 day), station= sample(LETTERS[1:4],10,replace=TRUE)) for(i in 1:length(stations))

Re: [R] How to use an elements' name when creating a data frame via a for loop

2014-04-07 Thread arun
Hi, It is not clear what you really want.  Now, you mentions ?merge() etc.  If you don't want to use ?assign(), lst - list(as.data.frame(matrix(1:40,ncol=5)), as.data.frame(matrix(1:20,ncol=4)), as.data.frame(matrix(1:25,ncol=5)),as.data.frame(matrix(21:30,ncol=2)))  stations -

[R] How to use restricted cubic spline in survfit.cph function in survival package?

2014-03-06 Thread Zhiyuan Sun
Hello, I used PBC data set included in the survival package to fit a cox model. The model included a restricted cubic spline transformation on age. Then I tried using survfit function to predict a survival curve using the first row of the original data. I got an error message. The R code and

Re: [R] How to use restricted cubic spline in survfit.cph function in survival package?

2014-03-06 Thread Andrews, Chris
, March 05, 2014 10:52 PM To: r-help@r-project.org Cc: therneau.te...@mayo.edu Subject: [R] How to use restricted cubic spline in survfit.cph function in survival package? Hello, I used PBC data set included in the survival package to fit a cox model. The model included a restricted cubic spline

[R] How to use ddply

2014-01-13 Thread Amitabh Dugar
I have never used R-help to pose a question to the R-users community; is sending this Email the right way to do so? I am trying to use the ddply function in the plyr package to accomplish the following: I have a data frame of the type:      ticker monthend_n wgtdiff    ret 156      AA  

Re: [R] How to use ddply

2014-01-13 Thread arun
Hi, Try: ddply(test,.(monthend_n),mutate,quintiles=cut(wgtdiff,5)) A.K. On Monday, January 13, 2014 5:32 PM, Amitabh Dugar cleverc...@yahoo.com wrote: I have never used R-help to pose a question to the R-users community; is sending this Email the right way to do so? I am trying to use the

Re: [R] How to use ddply

2014-01-13 Thread David Winsemius
On Jan 13, 2014, at 1:29 PM, Amitabh Dugar wrote: I have never used R-help to pose a question to the R-users community; is sending this Email the right way to do so? I am trying to use the ddply function in the plyr package to accomplish the following: I have a data frame of the type:

[R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread Marino David
Hi all: Assume that I have variables, say v1, v2,...,v100 and I want to use one variable in each roop. How can I do this? See below for (i in 1:100){ f(vi) } Thanks David [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread arun
Hi, If the variables described are the columns in a data.frame,   set.seed(24)  dat1 - as.data.frame(matrix(sample(100,100*10,replace=TRUE),ncol=100))  f1 - function(x) mean(x,na.rm=TRUE)  sapply(1:100,function(i) f1(dat1[,i])) #or  sapply(colnames(dat1),function(x) f1(dat1[,x])) #IF these are

Re: [R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread Hervé Pagès
Hi David, On 12/14/2013 01:06 PM, Marino David wrote: Hi all: Assume that I have variables, say v1, v2,...,v100 and I want to use one variable in each roop. How can I do this? See below for (i in 1:100){ f(vi) } for (i in 1:100){ f(get(paste0(v, i))) } Cheers, H. Thanks David

Re: [R] How to use variables whose names are with number at end in R loop

2013-12-14 Thread Marino David
Thanks Hervé Pagès and A. K.. It works. Thank you! David 2013/12/14 Hervé Pagès hpa...@fhcrc.org Hi David, On 12/14/2013 01:06 PM, Marino David wrote: Hi all: Assume that I have variables, say v1, v2,...,v100 and I want to use one variable in each roop. How can I do this? See below

[R] how to use the readBin ?

2013-12-13 Thread 水静流深
how to use the readBin ? i want to write the extended ascii character `Œ` into a file named c:/testbin, and read it in the R console ,display it as `Œ` in R console. now i can write it . zz - file(c:/testbin, wb) writeBin(charToRaw(\u0152), zz) close(zz) when i open the file with

[R] How to use multiple test for trend in proportions?

2013-12-09 Thread celebrex
dataorder.csv http://r.789695.n4.nabble.com/file/n4681879/dataorder.csv I have a set of data as attached.Like (181,246,378).(180,228,378)And I want to use test for trend in proportions using (400,500,600) as denominator and get 119 p-valuesSo I use the code as

Re: [R] How to use multiple test for trend in proportions?

2013-12-09 Thread David Winsemius
On Dec 9, 2013, at 9:46 AM, celebrex wrote: dataorder.csv http://r.789695.n4.nabble.com/file/n4681879/dataorder.csv I have a set of data as attached.Like (181,246,378).(180,228,378). And I want to use test for trend in proportions using (400,500,600) as denominator and get 119

Re: [R] How to use For loop to read multiple files

2013-11-20 Thread arun
Hi, I guess the trouble is here: lapply(1:4,function(i) {paste((file_,i,.txt),sep=)}) Error: unexpected ',' in lapply(1:4,function(i) {paste((file_,  lapply(1:4,function(i) {paste(file_,i,.txt,sep=)}) #works #or lapply(1:4,function(i) {paste0(file_,i,.txt,sep=)}) A.K. Hi guys im having

Re: [R] How to use For loop to read multiple files

2013-11-20 Thread arun
I forgot to delete the `sep` from the 2nd option:  lapply(1:4,function(i) {paste0(file_,i,.txt)}) A.K. On Thursday, November 21, 2013 1:43 AM, arun smartpink...@yahoo.com wrote: Hi, I guess the trouble is here: lapply(1:4,function(i) {paste((file_,i,.txt),sep=)}) Error: unexpected ',' in

[R] how to use a column name from the data frame in the function

2013-08-22 Thread song song
for example I have data frame m as below: m=as.data.frame(outer(1:5,6:9)) colnames(m)=c('a','b','c','d') and I define the function myf=function(df, colname){ suppose colname is a, then: how can I get the column 'a' and how to get the colname as a string, 'a' } Thank you!

[R] how to use a column name from the data frame in the function

2013-08-22 Thread song song
m=as.data.frame(outer(1:5,6:9)) colnames(m)=c('a','b','c','d') tf=function(df, col){list(mean(eval(substitute(col),df,parent.frame())),col )} tf(m,a) will issue error: Error in tf(m, a) : object 'a' not found How can I replace the col as char 'a' in the function? Thank you

Re: [R] how to use a column name from the data frame in the function

2013-08-22 Thread Jeff Newmiller
Please don't post in HTML format... it messes with code examples. Use character indexing (please read the Introduction to R... again if necessary). myf - function(df, colname){ df[ ,colname ] } colname - a myf(m,colname) Until you learn simple R syntax, I strongly recommend avoiding

Re: [R] How to use character in C code?

2013-05-17 Thread Jan van der Laan
Characters in R are zero terminated (although I couldn't find that in the R extensions manual). So, you could use: void dealWithCharacter(char **chaine, int *size){ Rprintf(The string is '%s'\n, chaine[0]); } Jan On 05/10/2013 03:51 PM, cgenolin wrote: Hi the list, I include some C

[R] How to use character in C code?

2013-05-10 Thread cgenolin
Hi the list, I include some C code in a R function using .C. The argument is a character. I find how to acces to the characters one by one: --- 8 --- C void dealWithCharacter(char **chaine, int *size){ int i=0; for(i=0;i*size;i++){ Rprintf(Le caractere %i est

Re: [R] How to use character in C code?

2013-05-10 Thread Suzen, Mehmet
You may want to use C++ instead using Rcpp which string handling would be easier: http://gallery.rcpp.org/articles/strings_with_rcpp/ On 10 May 2013 15:51, cgenolin cgeno...@u-paris10.fr wrote: Hi the list, I include some C code in a R function using .C. The argument is a character. I find

[R] How to use SparseM-conversions to convert a dCgMatrix into a matrix.csr ?

2013-05-07 Thread Yi Yuan
Hi all, I want to transform a dCgMatrix from package Matrix into a matrix.csr from package SparseM, and I found out this link : http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/SparseM-conv.html But there's no informaion about usage/description/arguments, so how do I use this

[R] How to use big.matrix to read factor columns

2013-05-07 Thread li li
I have a big data set that includes character variables of many different values. I'm trying to read the data as big.matrix and then use biglm.big.matrix to build linear models. However, since big.matrix will convert all character vectors to factors and the character labels will be lost, I

Re: [R] how to use Excel VBA's Shell() to call and execute R file

2013-05-06 Thread kuna_matata
I realize this is an old post, but thought it's good to answer for other folks that hit it during a search. RExcel is fantastic. However, it requires all the users to install RExcel. So the VBA approach may still be a good alternative in some simple cases, like the example question. I think what

Re: [R] How to use parentheses and degree symbol together?

2013-03-27 Thread Patrick Connolly
On Tue, 26-Mar-2013 at 05:05PM +0900, Pascal Oettli wrote: | Hi, | | You are right. The following should solve that problem: | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree*C))) It's not *exactly* the same. It uses a different font family for the brackets, evidently from

[R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
I'm interested in using a regular bracket with the degree symbol as an axis label but it's somewhat simpler to show what I mean in a text statement. plot(0, 0, pch = ) If I'm easy to please, this would suffice: text(0, .5, expression(Temperature * degree ~ C)) But I'm not that easily pleased.

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
Hi, Is it what you are looking for? plot(0, 0, pch = ) text(0, .5, expression(Temperature~(degree ~ C))) text(0, .4, substitute(paste(Temperature, B * degree, C)), list(B = ())) Hope this help, Pascal On 26/03/13 16:12, Patrick Connolly wrote: I'm interested in using a regular bracket

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
On Tue, 26-Mar-2013 at 04:20PM +0900, Pascal Oettli wrote: | Hi, | | Is it what you are looking for? | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree ~ C))) That produces an unwanted space between the degree symbol and the C. The search continues. Thanks | text(0, .4,

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
Hi, You are right. The following should solve that problem: plot(0, 0, pch = ) text(0, .5, expression(Temperature~(degree*C))) HTH, Pascal On 26/03/13 16:55, Patrick Connolly wrote: On Tue, 26-Mar-2013 at 04:20PM +0900, Pascal Oettli wrote: | Hi, | | Is it what you are looking for? | |

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Patrick Connolly
On Tue, 26-Mar-2013 at 05:05PM +0900, Pascal Oettli wrote: | Hi, | | You are right. The following should solve that problem: | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree*C))) That does it, and is perfectly readable. Now why didn't I think of that? I knew there had to

Re: [R] How to use parentheses and degree symbol together?

2013-03-26 Thread Pascal Oettli
You're welcome. On 26/03/13 17:12, Patrick Connolly wrote: On Tue, 26-Mar-2013 at 05:05PM +0900, Pascal Oettli wrote: | Hi, | | You are right. The following should solve that problem: | | plot(0, 0, pch = ) | text(0, .5, expression(Temperature~(degree*C))) That does it, and is perfectly

[R] How to use RWeka with Multilayer Perceptron?

2013-03-25 Thread Rui Esteves
Hello, I have a serialized Multilayer Perceptron trained using weka. I would like to use R to re-evaluate the model. How can I do this? I could not find an example of RWeca that applies to Multilayer Perceptron. Thanks, Rui __ R-help@r-project.org

Re: [R] how to use ...

2013-01-31 Thread Ivan Calandra
Dear Patrick, This is indeed a nice post to address the three dot issues. It is definitely much clearer to me now Thanks! Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000 Dijon, FRANCE +33(0)3.80.39.63.06 ivan.calan...@u-bourgogne.fr

Re: [R] how to use ...

2013-01-31 Thread Ivan Calandra
Thanks Bert for your example. I wouldn't say that I understand why everything happens the way it does, but at least I now know what happens! I think I now need to use it and try around! Ivan -- Ivan CALANDRA Université de Bourgogne UMR CNRS/uB 6282 Biogéosciences 6 Boulevard Gabriel 21000

Re: [R] how to use ...

2013-01-30 Thread Patrick Burns
There is now a blog post that attempts to answer the question in the subject line: http://www.burns-stat.com/the-three-dots-construct-in-r/ Pat On 17/01/2013 14:36, Ivan Calandra wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses

Re: [R] how to use ...

2013-01-30 Thread Bert Gunter
Because R can be interactive, I find that a little exploring through the use of strategically placed browser() calls (?browser if you are unfamiliar with this handy debugging tool) is often the fastest way to solve little R puzzles like this. For example, try this (in an R GUI): f2 -

Re: [R] how to use ...

2013-01-21 Thread Ivan Calandra
Since this topic was mine originally, I supposed I can give my opinion, for what it's worth! First, it is true that there is some help in the manuals. The problem with these manuals (or at least, my problem) is that there were much too complicated when I started to learn R. Then I got used to

Re: [R] how to use ...

2013-01-20 Thread Steve Taylor
From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that one, either. Duncan, I assume you're being facetious. Every R user soon learns to use help() and help.search() or their

Re: [R] how to use ...

2013-01-20 Thread Duncan Murdoch
On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that one, either. Duncan, I assume you're being facetious. Every R user soon learns to use

Re: [R] how to use ...

2013-01-20 Thread Steve Taylor
On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that one, either. Duncan, I assume you're being facetious. Every R user soon learns

Re: [R] how to use ...

2013-01-20 Thread Duncan Murdoch
On 13-01-20 2:56 PM, Steve Taylor wrote: On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that one, either. Duncan, I assume you're being

Re: [R] how to use ...

2013-01-20 Thread John Sorkin
Why are the help pages not right? The ... construct is a fundamental part of the language syntax. Information about this fundamental construct should be easily available! John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division

Re: [R] how to use ...

2013-01-20 Thread Duncan Murdoch
On 13-01-20 5:54 PM, John Sorkin wrote: Why are the help pages not right? The ... construct is a fundamental part of the language syntax. Information about this fundamental construct should be easily available! Yes, I agree it should be easily available. Why does that mean it has to be on

Re: [R] how to use ...

2013-01-20 Thread Ista Zahn
On Sun, Jan 20, 2013 at 5:54 PM, John Sorkin jsor...@grecc.umaryland.edu wrote: Why are the help pages not right? The ... construct is a fundamental part of the language syntax. Information about this fundamental construct should be easily available! This strikes me as a bit harsh. The

Re: [R] how to use ...

2013-01-20 Thread David Winsemius
On Jan 20, 2013, at 11:46 AM, Duncan Murdoch wrote: On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that one, either. Duncan, I assume

Re: [R] how to use ...

2013-01-20 Thread Duncan Murdoch
On 13-01-20 6:23 PM, David Winsemius wrote: On Jan 20, 2013, at 11:46 AM, Duncan Murdoch wrote: On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't

Re: [R] how to use ...

2013-01-20 Thread David Winsemius
On Jan 20, 2013, at 3:52 PM, Duncan Murdoch wrote: On 13-01-20 6:23 PM, David Winsemius wrote: On Jan 20, 2013, at 11:46 AM, Duncan Murdoch wrote: On 13-01-20 2:28 PM, Steve Taylor wrote: From: Duncan Murdoch Maybe we just need a manual on how to use the existing help system. But I

Re: [R] how to use ...

2013-01-18 Thread Duncan Murdoch
On 13-01-17 10:00 PM, John Sorkin wrote: Rolf Perhaps the philosophy of the help system needs to change . . . And perhaps it doesn't. Who knows? Maybe we just need a manual on how to use the existing help system. But I suspect people who won't read the existing manuals won't read that

[R] how to use ...

2013-01-17 Thread Ivan Calandra
Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side

Re: [R] how to use ...

2013-01-17 Thread R. Michael Weylandt
On Thu, Jan 17, 2013 at 2:36 PM, Ivan Calandra ivan.calan...@u-bourgogne.fr wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a

Re: [R] how to use ...

2013-01-17 Thread Berend Hasselman
On 17-01-2013, at 15:36, Ivan Calandra ivan.calan...@u-bourgogne.fr wrote: Dear users, I'm trying to learn how to use the I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer

Re: [R] how to use ...

2013-01-17 Thread Ivan Calandra
Ok, it is that simple... Actually I had tried it but messed up so that it didn't work. Do you know where I can find some documentation about it? Regarding return(), I know that it's not necessary, but when the function gets more complicated, I like to have it because it becomes clearer to me.

<    1   2   3   4   5   6   >