[R] Using a text file as a removeWord dictionary in tm_map

2015-02-28 Thread Sun Shine
Hi list Although this query applies specifically to the tm package, perhaps it's something that others might be able to lend a thought to. Using tm to do some initial text mining, I want to include an external (to R) generated dictionary of words that I want removed from the corpus. I have

Re: [R] title of r plots

2015-02-28 Thread William Dunlap
Use help(plotmath) to see all the details - you can use tildes for spaces, asterisks for no spaces. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Feb 27, 2015 at 8:52 PM, li li hannah@gmail.com wrote: Thanks very much. Also How do add an empty space when using expression()? When

Re: [R] Substring replacement in string

2015-02-28 Thread Gabor Grothendieck
On Fri, Feb 27, 2015 at 5:19 PM, Alrik Thiem alrik.th...@gmail.com wrote: I would like to replace all lower-case letters in a string that are not part of certain fixed expressions. For example, I have the string: pmin(pmax(pmin(x1, X2), pmin(X3, X4)) == Y, pmax(Z1, z1)) Where I would like to

Re: [R] Substring replacement in string

2015-02-28 Thread Alrik Thiem
Dear Michael I'm not sure how you mean this. Maybe a more general description of my problem is helpful for clarifying. What I have to deal with are truth table output functions that always take, for example, the following form: Delta - (a*B+a*C*d=Y)*(E+e) I.e. these functions will always

[R] Package survMisc

2015-02-28 Thread Endy BlackEndy
Hi R users. I have some problems with the package “survMisc”. When I am loading it I am getting the following library(survMisc) Loading required package: survival Loading required package: splines Loading required package: km.ci Loading required package: ggplot2 Loading required package:

Re: [R] Substring replacement in string

2015-02-28 Thread William Dunlap
string - pmin(1, x) expr - parse(text=string)[[1]] will convert the string to an unevaluated language object. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Feb 27, 2015 at 11:25 PM, Alrik Thiem alrik.th...@gmail.com wrote: Many thanks. Unfortunately, I cannot work directly on these

Re: [R] Substring replacement in string

2015-02-28 Thread Hervé Pagès
Hi Alrik, With the Biostrings/IRanges infrastructure (Bioconductor packages), you can do this with: library(Biostrings) x0 - BString(pmin(pmax(pmin(x1, X2), pmin(X3, X4)) == Y, pmax(Z1, z1))) donttouch_words - c(pmin, pmax) ## Extract the substrings to modify (target substrings).

Re: [R] Lubridate and NameSpace

2015-02-28 Thread Roy Mendelssohn - NOAA Federal
Not certain but perhaps: lubridate::%m+% there is a subtle difference between what the two and three colons do. -Roy On Feb 28, 2015, at 9:25 AM, Glenn Schultz glennmschu...@me.com wrote: Hello All, I am working on a package very near completion - roxygenizing it now. The namespace

Re: [R] Substring replacement in string

2015-02-28 Thread Alrik Thiem
Dear Gabor, Many thanks. Works like a charm, but I can't get it to work with pmin(pmax(pmin(a,B),pmin(a,C,d))==Y,pmax(E,e)) i.e., with strings where there're no integers following the components in the pmin/pmax functions. Could this be generalized to handle both cases? Best wishes, Alrik

Re: [R] Substring replacement in string

2015-02-28 Thread Michael Dewey
Dear Alrik This may seem a silly suggestion but why not just define new functions PMIN and PMAX to call pmin and pmax. Obviously that does not solve your problem if it is more general than your example. On 28/02/2015 13:16, Alrik Thiem wrote: Dear Gabor, Many thanks. Works like a charm,

[R] scatter plot matrix with multiple trend lines and p values

2015-02-28 Thread tianshu
I am trying to create a scatter plot matrix in which the lower panels contain scatter plots colored by group with trend lines by group, and the upper panels contain r and p values. Using pairs() I was able to get close (ie, scatter plot matrix on bottom with one trend line and correlation

[R] r script in web

2015-02-28 Thread hamid-reza kadkhodazadeh
hi i want to run r script in web without install r on server(my server is windows). is it possible?how? thank you [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Lubridate and NameSpace

2015-02-28 Thread Glenn Schultz
Hello All, I am working on a package very near completion - roxygenizing it now.  The namespace imports from lubridate importFrom(lubridate,%m+%).  The problem is: Lubridate will not load with bondlab, I have to manually click on lubridate in R Studio to load it I tried calling function using

[R] Firefox not showing R help.

2015-02-28 Thread Rolf Turner
Firefox recently updated itself on my laptop. Now when I ask for R help --- e.g. ?plot --- I just get my home page. And no help. If I do ?plot again after Firefox has opened its window, I just get yet another Firefox window, opened to my home page. (I have my preferences set to When

Re: [R] Firefox not showing R help.

2015-02-28 Thread Duncan Murdoch
On 28/02/2015 4:10 PM, Rolf Turner wrote: Firefox recently updated itself on my laptop. Now when I ask for R help --- e.g. ?plot --- I just get my home page. And no help. If I do ?plot again after Firefox has opened its window, I just get yet another Firefox window, opened to my home

Re: [R] Firefox not showing R help.

2015-02-28 Thread Rolf Turner
See inline below. On 01/03/15 10:59, Duncan Murdoch wrote: On 28/02/2015 4:10 PM, Rolf Turner wrote: Firefox recently updated itself on my laptop. Now when I ask for R help --- e.g. ?plot --- I just get my home page. And no help. If I do ?plot again after Firefox has opened its window, I

Re: [R] r script in web

2015-02-28 Thread Jeff Newmiller
I cannot see how that would be possible. R must be installed in order to use it. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#.

Re: [R] Substring replacement in string

2015-02-28 Thread Alrik Thiem
Ah, I see what you mean. Thanks for suggesting. I'll try. -Ursprüngliche Nachricht- Von: Michael Dewey [mailto:i...@aghmed.fsnet.co.uk] Gesendet: Samstag, 28. Februar 2015 17:31 An: Alrik Thiem Cc: r-help@r-project.org Betreff: Re: AW: [R] Substring replacement in string Your original

Re: [R] evaluate logical expressions

2015-02-28 Thread JS Huang
Hi, I assume input y to wrapper - function(y) {function(x) {(y)}} is a function. In the statement to assign gfunc[[i]]- gsub((Gene)([[:digit:]]), x[\\2], func[[i]]) the mode of gsub((Gene)([[:digit:]]), x[\\2], func[[i]]) is character. Is this the issue? -- View this message in context:

Re: [R] Substring replacement in string

2015-02-28 Thread Alrik Thiem
Dear Gabor, That works perfectly! Many thanks and best wishes, Alrik -Ursprüngliche Nachricht- Von: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Gesendet: Samstag, 28. Februar 2015 19:30 An: Alrik Thiem Cc: r-help@r-project.org Betreff: Re: [R] Substring replacement in string

Re: [R] Substring replacement in string

2015-02-28 Thread Michael Dewey
Your original problem statement seemed to me to be one of wanting to transform all the lower case identifiers to upper except for pmin and pmax. My suggestion was not to bother and transform everything and then define PMIN and PMAX. On 28/02/2015 14:34, Alrik Thiem wrote: Dear Michael I'm

Re: [R] Substring replacement in string

2015-02-28 Thread Gabor Grothendieck
Replace the + (i.e. 1 or more) in the pattern with a * (i.e. 0 or more): x - pmin(pmax(pmin(a,B),pmin(a,C,d))==Y,pmax(E,e)) gsub((\\b[a-oq-z][a-z0-9]*), 1-\\U\\1, x, perl = TRUE) giving: [1] pmin(pmax(pmin(1-A,B),pmin(1-A,C,1-D))==Y,pmax(E,1-E)) Here is a visualization of the regular

Re: [R] Substring replacement in string

2015-02-28 Thread Alrik Thiem
Dear Hervé, Many thanks for your suggestion. Gabor Grothendieck proposed a simple one-liner that works perfectly for my purposes: gsub((\\b[a-oq-z][a-z0-9]*), 1-\\U\\1, x, perl = TRUE) where x is the respective string. Best wishes, Alrik -Ursprüngliche Nachricht- Von: Hervé Pagès