similar to: return value of {....}

Displaying 20 results from an estimated 2000 matches similar to: "return value of {....}"

2023 Oct 16
1
Create new data frame with conditional sums
If one makes the reasonable assumption that Pct is much larger than Cutoff, sorting Cutoff is the expensive part e.g O(nlog2(n) for Quicksort (n = length Cutoff). I believe looping is O(n^2). Jeff's approach using findInterval may be faster. Of course implementation details matter. -- Bert On Mon, Oct 16, 2023 at 4:41?AM Leonard Mada <leo.mada at syonic.eu> wrote: > > Dear
2023 Oct 16
1
Create new data frame with conditional sums
Dear Jason, The code could look something like: dummyData = data.frame(Tract=seq(1, 10, by=1), ?? ?Pct = c(0.05,0.03,0.01,0.12,0.21,0.04,0.07,0.09,0.06,0.03), ?? ?Totpop = c(4000,3500,4500,4100,3900,4250,5100,4700,4950,4800)) # Define the cutoffs # - allow for duplicate entries; by = 0.03; # by = 0.01; cutoffs <- seq(0, 0.20, by = by) # Create a new column with cutoffs dummyData$Cutoff
2024 Jan 30
2
Use of geometric mean for geochemical concentrations
Dear Rich, It depends how the data is generated. Although I am not an expert in ecology, I can explain it based on a biomedical example. Certain variables are generated geometrically (exponentially), e.g. MIC or Titer. MIC = Minimum Inhibitory Concentration for bacterial resistance Titer = dilution which still has an effect, e.g. serially diluting blood samples; Obviously, diluting the
2010 Apr 19
2
How to pass a list of parameters into a function
Does anyone know how to pass a list of parameters into a function? for example: somefun=function(x1,x2,x3,x4,x5,x6,x7,x8,x9){ ans=x1+x2+x3+x4+x5+x6+x7+x8+x9 return(ans) } somefun(1,2,3,4,5,6,7,8,9) # I would like this to work: temp=c(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9) somefun(x1=1,x2=2,temp) # OR I would like this to work: temp=list(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9)
2005 Feb 14
1
how can i make my program faster
Hello, right now, i have a program to collect data into a table. right now, my table is table1 <- data.frame(trial = NA, x = NA, y = NA) for each time when i want to add data into my data, i have to copy data of table into an array for each column, and then i add new data into my array, then i copy my array into the table one column by one column. For example temptrial <- table1$trial;
2023 Oct 21
1
Issue from R-devel: subset on table
My mistake! It does actually something else, which is incorrect. One could still use (although the code is more difficult to read): subset(tmp <- table(sample(1:10, 100, T)), tmp > 10) Sincerely, Leonard On 10/21/2023 10:26 PM, Leonard Mada wrote: > Dear List Members, > > There was recently an issue on R-devel (which I noticed only very late): >
2023 Mar 19
2
lexical scoping for scripts......
Dear Duncun, What if there is no interactive "session" running? I will be running my scripts automatically from crontab in Linux. THanking you, Yours sincerely, AKSHAY M KULKARNI ________________________________ From: Duncan Murdoch <murdoch.duncan at gmail.com> Sent: Monday, March 20, 2023 12:20 AM To: akshay kulkarni <akshay_e4 at hotmail.com>; R
2007 Mar 27
3
Bridging R to OpenOffice
Dear members of the R Development Team, I am looking for people with a deep understanding of R internals to assist in bridging R to OpenOffice. While R is a state of the art statistical environment, less experienced users often find it difficult to work with R. Therefore, I believe that a bridge between R and a spreadsheet program will make this transition less painful. I sincerely believe
2023 Mar 19
1
lexical scoping for scripts......
Again, the answer is "interactivity does not matter". On March 19, 2023 12:54:28 PM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote: >Dear Jeff, > I will not be running R command in the shell prompt. So there is no banner, no > prompt. Just running "myscript.R" from the shell prompt. or from crontab in Linux. I think you get the
2023 Mar 19
1
lexical scoping for scripts......
On 19/03/2023 2:55 p.m., akshay kulkarni wrote: > Dear Duncun, > ? ? ? ? ? ? ? ? ? ? ? ? ?What if there is no interactive "session" > running? I will be running my scripts automatically from crontab in Linux. I was talking about the session that is created for the duration of the BATCH run, not some other session that may be running in another process. Sorry for the
2023 Jan 12
4
return value of {....}
Hello Akshay, R is quite inspired by LISP, where this is a common thing. It is not in fact that {...} returned something, rather any expression evalulates to some value, and for a compound statement that is the last evaluated expression. {...} might be seen as similar to LISPs (begin ...). Now this is a very different thing compared to {...} in something like C, even if it looks or behaves
2023 Jan 09
3
return value of {....}
Dear Valentin, But why should {....} "return" a value? It could just as well evaluate all the expressions and store the resulting objects in whatever environment the interpreter chooses, and then it would be left to the user to manipulate any object he chooses. Don't you think returning the last, or any value, is redundant? We are living in the 21st century
2017 Dec 15
6
something weird has happened....!!!!!!!!!!
dear Members, Today something weird has happened on my R console. I have attached two screenshots of the same vector in my R console but they differ. Also one of my function returns negative values, even after double checking the code, which should return only positive values.. Whats wrong..? Reinstall R? Thanks for help.... AKSHAY M KULKARNI -------------- next part -------------- A
2023 Mar 19
1
lexical scoping for scripts......
Dear Jeff, I will not be running R command in the shell prompt. So there is no banner, no > prompt. Just running "myscript.R" from the shell prompt. or from crontab in Linux. I think you get the context..... thanking you, yours sincerely AKSHAY M KULKARNI ________________________________ From: Jeff Newmiller <jdnewmil at dcn.davis.ca.us> Sent: Monday, March
2023 Apr 04
1
on lexical scoping....
No, there are lots of situations where that doesn't make sense. You don't want to have to define local copies of the functions from every package you use, for example. I think the takeaway is to learn how R scoping works, and keep things simple. That's one reason I tend to avoid "tidyverse" packages. There are a lot of really good ideas in those packages, but
2023 Mar 19
1
lexical scoping for scripts......
What do _you_ mean when you use the term "interactive"? Because R distinguishes between executing code in a function and executing code from the global environment, but it does not care whether a person is doing the typing or not. I get the feeling that you think of your R code in terms of "scripts" when you should be thinking of your code in terms of functions. What
2023 Jan 09
5
return value of {....}
Dear members, I have the following code: > TB <- {x <- 3;y <- 5} > TB [1] 5 It is consistent with the documentation: For {, the result of the last expression evaluated. This has the visibility of the last evaluation. But both x AND y are created, but the "return value" is y. How can this be advantageous for solving practical problems?
2023 Apr 04
6
on lexical scoping....
Dear Members, I have the following code typed at the console prompt: y <- x*10 X has not been defined and the above code throws an object not found error. That is, the global environment does not contain x. Why doesn't it look further in the environment stack, like that of packages? There are thousands of packages that contain the variable named x. Of
2008 May 04
2
Categorizing Fonts using Statistical Methods
Dear list members, Every "modern" OS comes with dozens of useless fonts, so that the current font drop-down list in most programs is overcrowded with fonts one never will use. Selecting a useful font becomes a nightmare. In an attempt to ease the selection of useful fonts, I began looking into sorting fonts using some statistical techniques. I summed my ideas on the OpenOffice.org
2023 Apr 04
1
on lexical scoping....
Dear Duncan, THanks for the reply...! So the takeaway is that define the symbol in the same environment before using it right!? Thanking you, Yours sincerely, AKSHAY M KULKARNI ________________________________ From: Duncan Murdoch <murdoch.duncan at gmail.com> Sent: Tuesday, April 4, 2023 8:21 PM To: akshay kulkarni <akshay_e4 at hotmail.com>; Deepayan Sarkar