similar to: A question about function behavior

Displaying 20 results from an estimated 20000 matches similar to: "A question about function behavior"

2010 Jul 27
6
Eval() or parse() do not work inside function
I am writing a function where the arguments are names of objects or variable names in a data frame. To convert the strings to the objects I am using eval(parse(text=name)): f.graph.two.vbs<-function(dataname,v1){ val<-paste(dataname,v1,sep="$") val<-eval(parse(text=val)) val } However running this returns an error:
2005 Apr 20
1
overlaying a contour line in a levelplot
Hello there, I am creating a series of images using levelplot but I also want to overlay a contour for a particular value as reference. Here is the levelplot command for the image: print(levelplot(d~x+y,data=t,cuts=20,scales=list(draw=F),xlab=NULL,ylab= NULL,col.regions=heat.colors(100)[100:1]),split=c(1,1,1,1),more=T) and then to add the contour plot (I only want a contour at level 5):
2011 Oct 26
2
New column of data filled with the larger value from 2 columns
Hi, I'm sure there is a pretty simple answer to this but I have had my head buried in the R book and on help pages for a while now and I've not made any progress. In simple terms: I have 2 columns of data, column A and column B. I want to create a new column (C) and fill it with the largest value from of A or B on each row. So I want C to contain A if B>A and C to contain B if
2002 May 30
1
neighbor.grid and spatial.weights
Anyobody knows if functions neighbor.grid and spatial.weights (from module spatial) have any 'equivalents' in R ? Thanks. JA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the
2003 Aug 11
2
Changing default browser in options()
I usually startup R from within several directories (usually where the programs or data of interest are). I like to use a small web browser called dillo to browse help files. However, by default R looks for mozilla, so I have to type every single R session: > options(browser='dillo') Is there anyway I can change this globally? thanks, J.
2008 Jun 03
3
matlab eigs function in R
Hello Does anybody know how one can compute d largest eigenvalues/eigenvectors in R, like in MATLAB eigs function ? eigen function computes all eigenvectors/eigenvalues, and they are slightly different than those generated by matlab eigs. Thanks in advance -- View this message in context: http://www.nabble.com/matlab-eigs-function-in-R-tp17619641p17619641.html Sent from the R help mailing list
2008 Sep 05
5
Lowest k values of list
Hi @ all, how do I get the largest or lowest k values of list? It must similar to the min() / max() function, but I just don't get it. Best wishes, Markus
2010 Nov 08
4
Random Sample
Hello R users, Here is my question about generating random sample. How to set the random seed to recreate the same random numbers? For example, 10 random numbers is generated from N(0,1), then "runif(10)" is used.What if I want to get the same 10 random numbers when I run runif(10) again? Is it possible?I think .Random.seed should be used here. Thanks. Xiaoxi [[alternative
2013 Aug 06
2
Using freeswitch and Icecast
Hi I am trying to use icecast to broadcast a realtime conference from freeswitch. But I am having a delay like 20 seconds then I reduced it to 12s. But I don't know if somebody can help me how to reduce it as lower as possible. Thanks Jorge -------------- next part -------------- An HTML attachment was scrubbed... URL:
2013 Aug 07
1
Using freeswitch and Icecast
what-he-said On 08/07/2013 06:48 AM, Basil Mohamed Gohar wrote: > On 08/06/2013 07:40 PM, Jorge N??ez wrote: >> Hi I am trying to use icecast to broadcast a realtime conference from >> freeswitch. But I am having a delay like 20 seconds then I reduced it to >> 12s. But I don't know if somebody can help me how to reduce it as lower >> as possible. >> >>
2013 Mar 21
5
Help on indicator variables
I have two indicator variables ABS and DEFF. I want to create another indicator variable which will take value 1 if either ABS=1 or DEFF=1. Otherwise, it will take value 0. How can I make that? [[alternative HTML version deleted]]
2003 Jan 31
2
minor error in documentation of pmax in base (PR#2513)
The documentation says, "pmax and pmin take several vectors as arguments and return a single vector giving the parallel maxima (or minima) of the vectors." I discovered that, if you use a matrix or array instead of a vector, pmax returns a matrix or array, respectively. This makes pmax and pmin much more useful, and should not be left to people to discover on their own! For example:
2005 Apr 18
5
the graph gallery strikes back
Hello useRs and helpRs, Some time ago, in a gallaxy far away (here is the thread : http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we discussed about a graph gallery showing the power of R in that domain. I did some work around that, and there is a (pretty advanced) draft here : http://addictedtor.free.fr/graphiques/displayGallery.php For instance, there are some of my graphs,
2015 Dec 24
2
override pmin/pmax for my own matrix
Hello, I'm trying to override pmin and pmax for my own matrix. These two functions have ... as an argument. I tried to override them as follows: setMethod("pmax", class_name, function(x, ..., na.rm) { ... }) I use this way to override primitive functions such as min/max and it works fine. But it doesn't work for pmin and pmax. I guess because they are regular functions? How
2011 Aug 11
1
Any Method for capturing ISUP packets in DAHDI/ASTERISK
Hi All, I want packets [request/response] capture for ISUP packets , i have E1 line terminated to my digium card i just want a packets flow between my machine and teleco side, is any tool or utility [command] availabele for observation this packets and data. any help appericiated Thanks Dhaval -------------- next part -------------- An HTML attachment was scrubbed... URL:
2013 Jun 22
2
SIP Trunking Mantra (Origination)
Hello Everyone, We are currently having talks with various service providers, and trying to determine what the best way is to interconnect in order to have access to the PSTN network. As you know there are two ways of doing this: Traditional PRI: Have trunks grouped into a transport layer such as OC3/12. With DIDs attached to the group. As you many know, this approach would also require a POP
2003 Nov 13
1
RE: Aculab SS7/ISUP (new subject)
>Freddi Hansen wrote: >> with boards from Aculab, we are replacing Aculab boards with Digium >> boards BUT we would need more >> Digium boards IF we could use both Digium and Aculab cards in the same >> server. The reason being that >> TE410P doesn't support SS7-ISUP so we continue using only Aculab cards >> in the servers that must support >>
2019 Jan 21
2
pmax and long vector
I see that base::pmax() does not support long vectors. Is R-devel interested in reports like this; ie. is there a goal of full support for long vectors in "basic" functions, something I at least would greatly appreciate? MRE: > pmax(rep(1L, 3*10^9), 0) Error in pmax(rep(1L, 3 * 10^9), 0) : long vectors not supported yet: ../../../R-devel-src/src/include/Rinlinedfuns.h:522 Best,
2013 Apr 18
5
Subsetting a large number into smaller numbers and find the largest product
Hello, I have a big number lets say of around hundred digits. I want to subset that big number into consecutive number of 5 digits and find the product of those 5 digits. For example my first 5 digit number would be 73167. I need to check the product of the individual numbers in 73167 and so on. The sample number is as follows:
2012 Oct 30
4
There is pmin and pmax each taking na.rm, how about psum?
Hi, Please consider the following : x = c(1,3,NA,5) y = c(2,NA,4,1) min(x,y,na.rm=TRUE) # ok [1] 1 max(x,y,na.rm=TRUE) # ok [1] 5 sum(x,y,na.rm=TRUE) # ok [1] 16 pmin(x,y,na.rm=TRUE) # ok [1] 1 3 4 1 pmax(x,y,na.rm=TRUE) # ok [1] 2 3 4 5 psum(x,y,na.rm=TRUE) [1] 3 3 4 6 # expected result Error: could not find function "psum" # actual result