Re: [R] understanding with

2016-09-09 Thread Jeff Newmiller
Indeed, you don't have to write code with constructs you don't like, but you should be able to read it. Considerable effort under the label "scope" [1] is expended in programming language design specifically to allow re-use of variable names in different contexts. Because I do understand scope,

Re: [R] Apply a multi-variable function to a vector

2016-09-09 Thread Jeff Newmiller
Not sure I understand what you really want, if you have found ways to accomplish what you want but are not satisfied with them. That is one reason why keeping the mailing list involved (by reply-all) is good for you. From my end, I don't do one-on-one support online, and may not be able to carr

Re: [R] element wise pattern recognition and string substitution

2016-09-09 Thread Jun Shen
Hi Jeff, I have been trying different methods and found your approach is the most efficient. I am able to resolve the string-parsing problem. Let me report back to the group. This following example explains what I was trying to achieve. melt.results is where the strings reside, testdata is a sni

[R] GGplot annotate by facet

2016-09-09 Thread Khan, Saad M. (MU-Student)
Hi, I have a dataframe which I need to plot in ggplot2 it looks like this :- head(nodelta_firstexon) Value Type Histone 1 0.06 high H3K27ac 2 0.12 low H3K27ac 4 0.04 high H3K27me3 5 0.16 low H3K27me3 7 0.02 high H3K36me3 8 0.13 low H3K36me3 I have another data frame with p-v alues

Re: [R] understanding with

2016-09-09 Thread Sarah Goslee
Hi Carl, The duplicate names were to demonstrate the difference in search path and environment, since you appeared to be confused. If you dislike with, don't use it. On Fri, Sep 9, 2016 at 5:20 PM, Carl Sutton wrote: > Hi Sarah > > I see the difference, but pardon the big yawn, who writes cod

Re: [R] Apply a multi-variable function to a vector

2016-09-09 Thread Jeff Newmiller
Your architecture has a bad smell to me. For one thing you are mixing different units in the same vector but should be putting multiple instances of the same variable into one vector. Lists of vectors (data frames) are typically used when multiple variables need to be grouped. Another problem i

Re: [R] Apply a multi-variable function to a vector

2016-09-09 Thread William Dunlap via R-help
Try do.call(), as in > func2 <- function(time, temp) paste(time, temp) > func2(121, 10) [1] "121 10" > do.call(func2, as.list(c(121,10))) [1] "121 10" > do.call(func2, list(121,10)) [1] "121 10" > > func2(121, time=10:12) [1] "10 121" "11 121" "12 121" > do.call(func2, list(121,time=10:12)) [1] "1

[R] How to read a grib2 file

2016-09-09 Thread Debasish Pai Mazumder
Hi I am trying to read a grib2 file in R. Here is my script library(rgdal) library(sp) library(rNOMADS) gribfile<-"tmax.01.2011040100.daily.grb2" grib <- readGDAL(gribfile) I am getting following error : dec_jpeg2000: Unable to open JPEG2000 image within GRIB file. Is the JPEG2000 driver availa

[R] Apply a multi-variable function to a vector

2016-09-09 Thread Stephen Kennedy
Hello, I would like to define an arbitrary function of an arbitrary number of variables, for example, for 2 variables: func2 <- function(time, temp) time + temp I'd like to keep variable names that have a meaning in the problem (time and temperature above). If I have a vector of values

[R] Apply a multi-variable function to a vector

2016-09-09 Thread Steve Kennedy
Hello, I would like to define an arbitrary function of an arbitrary number of variables, for example, for 2 variables: func2 <- function(time, temp) time + temp I'd like to keep variable names that have a meaning in the problem (time and temperature above). If I have a vector of values for th

Re: [R] understanding with

2016-09-09 Thread Sarah Goslee
Like others on the list I have no interest in wading through your block of HTML-mangled text. But if your question is clearly stated by the subject line, then it's quite straightforward. with() saves you typing and often increases code clarity by telling R where to look for named variables # Thi

Re: [R] Matching/checking for occurence when values are double?

2016-09-09 Thread ruipbarradas
Not exactly, all.equal is much more complete. It accepts all kinds of objects, not just vectors. Rui Barradas Citando Ivan Calandra : Hi, Not sure, but it seems that your function equal() is exactly what all.equal() does, isn't it? Ivan -- Ivan Calandra, PhD Scientific Mediator Univers

Re: [R] Have help list filters changed recently

2016-09-09 Thread Mark Leeds
Hi Bert: I saw that and let it through. I am not the one to ask but as far as I know, the filtering has not changed. On Thu, Sep 8, 2016 at 8:35 PM, Bert Gunter wrote: > To all: > > r-help has been holding up a lot of my recent messages: Have there > been any changes to help list filters that c

[R] digital online identifier (doi) CRAN manual?

2016-09-09 Thread stephen sefick
Hello all, I apologize if this is the incorrect forum for this query. I am a package maintainer, and would like to have a doi for the package manual. What might be a good way to go about this? kindest regards, Stephen Sefick -- Let's not spend our time and resources thinking about things that a

Re: [R] Matching/checking for occurence when values are double?

2016-09-09 Thread Jorge Cimentada
Matching 100 to 100.0 or 100.00 or whatever N number of decimales will always return a TRUE. The expression your using is correct. A more complete expression would be kidmomiq[100 == kidmomiq$mom_iq, ]. On Fri, Sep 9, 2016 at 2:01 PM, Matti Viljamaa wrote: I need to pick from a dataset those

Re: [R] Matching/checking for occurence when values are double?

2016-09-09 Thread Ivan Calandra
Hi, Not sure, but it seems that your function equal() is exactly what all.equal() does, isn't it? Ivan -- Ivan Calandra, PhD Scientific Mediator University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros 51100 Reims, France +33(0)3 26 77 36 89 ivan.calan...@univ-

Re: [R] Matching/checking for occurence when values are double?

2016-09-09 Thread ruipbarradas
Hello, See FAQ 7.31. It's irrelevant if you write 100 or 100.0, the values are the same. The difference would be between 100 (double) and 100L (integer). To check for equality between floating-point numbers you can use, for instance, the following function. equal <- function(x, y, eps = .Ma

Re: [R] element wise pattern recognition and string substitution

2016-09-09 Thread Ista Zahn
On Sep 9, 2016 12:14 AM, "Jun Shen" wrote: > > Hi Ista, > > Imagine we have a data set called "all.exposure" with variables "TX","WTCUT" for a function. I don't think imagining your situation is the best way. Make an example so we can actually see what you are working with. The concatenated stri

Re: [R] get start and end date of ISO weeks giving a date as input

2016-09-09 Thread Veronica Andreo
Hello Enrico, 2016-09-08 10:41 GMT-03:00 Enrico Schumann : > Hi Veronica, > > please see inline. > > On Thu, 08 Sep 2016, Veronica Andreo writes: > > > Hello Luisfo and Enrico, > > > > Thanks for your help! I've been testing both > > solutions... results differ for the same date (I > > changed b

Re: [R] Comparison conditionals when extracting from data.frame not working reliably

2016-09-09 Thread Ista Zahn
Use & instead of && --Ista On Sep 9, 2016 8:12 AM, "Matti Viljamaa" wrote: > I’m getting strange behaviour when trying to extract rows from a > two-column data.frame with double values. > > My data looks like: > >mom_iq kid_score > 1 121.1175065 > 289.3618898 > 3

[R] Comparison conditionals when extracting from data.frame not working reliably

2016-09-09 Thread Matti Viljamaa
I’m getting strange behaviour when trying to extract rows from a two-column data.frame with double values. My data looks like: mom_iq kid_score 1 121.1175065 289.3618898 3 115.4432085 499.4496483 … and I’m testing extracting rows that have mom_

[R] Matching/checking for occurence when values are double?

2016-09-09 Thread Matti Viljamaa
I need to pick from a dataset those rows that have a double value set to 100. However since the values in this column are like the following: [1] 121.11750 89.36188 115.44320 99.44964 92.74571 107.90180 [7] 138.89310 125.14510 81.61953 95.07307 88.57700 94.85971 [13] 88.96280 114.11430 100

Re: [R] Have help list filters changed recently

2016-09-09 Thread Martin Maechler
> Marc Schwartz > on Thu, 8 Sep 2016 22:29:38 -0500 writes: >> On Sep 8, 2016, at 7:35 PM, Bert Gunter wrote: >> >> To all: >> >> r-help has been holding up a lot of my recent messages: Have there >> been any changes to help list filters that caused this? Is