Re: [Rd] best way to extract this meaningful data from a table

2013-02-18 Thread Kasper Daniel Hansen
This is not an R-devel question, so please do not reply to this list. I would try sapply(strsplit(loaded.topics$doc.id, "_"), function(xx) xx[1]) to get the MD part. Kasper On Mon, Feb 18, 2013 at 7:19 PM, bryan rasmussen wrote: > I have a table with a structure like the following: > > lang |

[Rd] best way to extract this meaningful data from a table

2013-02-18 Thread bryan rasmussen
I have a table with a structure like the following: lang | basic id | doc id | topics| se | 447157 | MD_2002_0014 |12 | loaded topics <- read.table("path to file",header=TRUE, sep="|", fileEncoding="utf-8") In that table the actual meaningful data (in this context) is the text before the first

[Rd] Including modified R source code in a package

2013-02-18 Thread Hadley Wickham
Hi all, I would like to include a function that I have made by modifying an existing R function (bw.SJ and corresponding code in bandwidths.c). The header of bandwidths.c states: /* * R : A Computer Language for Statistical Data Analysis * bandwidth.c by W. N. Venables and B. D. Ripley Copyr

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Matevz Pavlic
*Hi, first of all-thank you for your extensive answer.* > Hi, > > >> Not at all - R has a built-in webserver (it's used for the help pages), >> so > if you install R, you're done with that part. Rook >gives you a wrapper > for > that. > > What do you mean by wrapper? > >It defines an

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread Hadley Wickham
Ok, that's what I thought. Thanks! Hadley On Mon, Feb 18, 2013 at 12:43 PM, wrote: > Of course not. What I hope can happpen is that we can reduce the > degree to which internal implementation quirks leak out into the user > level. The fact that there is an internal "missing token" (that > happe

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread luke-tierney
Of course not. What I hope can happpen is that we can reduce the degree to which internal implementation quirks leak out into the user level. The fact that there is an internal "missing token" (that happens to be used for a couple of different things) is a quirk; if you look at the code I use you

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread Hadley Wickham
In general, should we expect that the ability to compute on the language within R will decrease over time? Otherwise, I presume if you do change the behaviour of missing then you'll still provide some way to create/call functions with missing arguments. Hadley On Mon, Feb 18, 2013 at 12:31 PM,

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread Hadley Wickham
On Mon, Feb 18, 2013 at 10:35 AM, peter dalgaard wrote: > > On Feb 18, 2013, at 17:04 , Hadley Wickham wrote: > >> quote(expr =) returning missing seems like the right thing to me, >> quote() throwing an error does not, because it violates the usual >> semantics where f(x = ) is equivalent to f().

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread luke-tierney
I wouldn't count on any way of capturing this thing being reliable in the long term. As I recall what I do in codetools and the compiler is use features of missing() to test for it, but try to abstract those uses into one or two places only so I can easily change them if missing()'s behavior chan

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread peter dalgaard
On Feb 18, 2013, at 17:04 , Hadley Wickham wrote: > quote(expr =) returning missing seems like the right thing to me, > quote() throwing an error does not, because it violates the usual > semantics where f(x = ) is equivalent to f(). Except that it isn't: > (function(...)nargs())() [1] 0 > (fun

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread Hadley Wickham
> If there is a bug here, I'd say that it is in str(), revealing the > implementation of the missing value as the symbol ``, Yes, a fix to str would be nice too :) > which we otherwise try not to disclose to R code, e.g. > >> as.symbol("") > Error in as.symbol("") : attempt to use zero-length va

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Simon Urbanek
On Feb 18, 2013, at 10:20 AM, Matevz Pavlic wrote: > Hi, > > >> Not at all - R has a built-in webserver (it's used for the help pages), so > if you install R, you're done with that part. Rook >gives you a wrapper for > that. > > What do you mean by wrapper? > It defines an API that is eas

Re: [Rd] quote() vs quote(expr=)

2013-02-18 Thread peter dalgaard
On Feb 18, 2013, at 16:20 , Hadley Wickham wrote: > Hi all, > > I think there's a small buglet in quote: > > str(quote()) > # Error in quote() : 0 arguments passed to 'quote' which requires 1 > str(quote(expr = )) > # symbol > If there is a bug here, I'd say that it is in str(), revealing the

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Matevz Pavlic
Hi, > No one yet has mentioned shiny (http://www.rstudio.com/shiny/); it > allows you to get up and prototyping quickly, and we're working on > ways to make it just as easy to scale to multiple users (currently > it's possible, but you have to be willing to get your hands dirty > configuring

[Rd] quote() vs quote(expr=)

2013-02-18 Thread Hadley Wickham
Hi all, I think there's a small buglet in quote: str(quote()) # Error in quote() : 0 arguments passed to 'quote' which requires 1 str(quote(expr = )) # symbol I bring this up because this seems like the most natural way of capturing the "missing" symbol with pure R code, compared to substitute()

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Matevz Pavlic
Hi, >Not at all - R has a built-in webserver (it's used for the help pages), so if you install R, you're done with that part. Rook >gives you a wrapper for that. What do you mean by wrapper? > The problem is it doesn't scale, so if you're happy with one-user solution > then you can use R wi

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Hadley Wickham
No one yet has mentioned shiny (http://www.rstudio.com/shiny/); it allows you to get up and prototyping quickly, and we're working on ways to make it just as easy to scale to multiple users (currently it's possible, but you have to be willing to get your hands dirty configuring servers etc). Hadle

[Rd] Small suggestion for termplot

2013-02-18 Thread Terry Therneau
Brian, I used termplot(..., plot=FALSE) recently in R-devel: works like a charm. Thanks much for the update. Our in-house "gamterms" function, which this obviates, would also return the "constant" attribute from the underlying predict(..., type="terms") call. I have occasionally found t

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Simon Urbanek
On Feb 18, 2013, at 6:24 AM, Matevz Pavlic wrote: > Hi, > > i think all of this i kinda complicated, even though in all the packages > authors are saying that "minimum code is required". > I mean, i am not an IT engineer , but i have created quite some webpages, so > i have some knowledge of H

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Mike Marchywka
> Date: Mon, 18 Feb 2013 04:13:25 -0800 > From: matevzpav...@gmail.com > To: r-devel@r-project.org > Subject: Re: [Rd] Passing R code from webpage > > Yes, > y > knowledge). well, this getting off topic but I could suggest you go get cygwin and learn t

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Matevz Pavlic
Yes, i have looked at apache, but there is no Windows version (at least to my knowledge). I know how to connect to MS SQL from R, i just dont know how to do that from web browser. thanks, m -- View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Mike Marchywka
> Date: Mon, 18 Feb 2013 03:24:43 -0800 > From: matevzpav...@gmail.com > To: r-devel@r-project.org > Subject: Re: [Rd] Passing R code from webpage > > Hi, > > i think all of this i kinda complicated, even though in all the packages > authors are saying t

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Matevz Pavlic
Hi, i think all of this i kinda complicated, even though in all the packages authors are saying that "minimum code is required". I mean, i am not an IT engineer , but i have created quite some webpages, so i have some knowledge of HTML5, CSS, C# (limited), and also work quite a lot with R and s

[Rd] nobs() with glm(family="poisson")

2013-02-18 Thread Milan Bouchet-Valat
Hi! The nobs() method for glm objects always returns the number of cases with non-null weights in the data, which does not correspond to the number of observations for Poisson regression/log-linear models, i.e. when family="poisson" or family="quasipoisson". This sounds dangerous since nobs() is,

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Mike Marchywka
> Date: Sun, 17 Feb 2013 04:27:38 -0800 > From: mehrotra.pul...@gmail.com > To: matevzpav...@gmail.com > CC: r-devel@r-project.org > Subject: Re: [Rd] Passing R code from webpage > > hi , > > First of all you should as this question on r-help rather than

Re: [Rd] Passing R code from webpage

2013-02-18 Thread Pulkit Mehrotra
hi , First of all you should as this question on r-help rather than on r-devel as this group deals with development related issues with R. As for the package you can use the shiny package from Rstudio. I have provided the links below. http://shiny.rstudio.org/ http://www.rstudio.com/shiny/ rega