Displaying 20 results from an estimated 1000 matches similar to: "Create a function with multiple object as an output"
2008 Nov 06
1
trouble with for loop
Hello,
I'm having two similar problems with for loop and I would appreciate
any help or comment.
I want to use "for loop" to calculate series of initial values for an
optimization problem. But
some initial values have my function quit due to problems like
calculating the inverse of singular
matrices. I don't want to make my program check determinants and skip it if it
is
2024 Jul 04
1
R FAQ 2.6, 7.21
Hello R-devel,
I would like to suggest a couple of updates for the R FAQ.
https://CRAN.R-project.org/bin/linux/suse is currently empty and the
directory has mtime from 2012, so it probably doesn't help to reference
it in FAQ 2.6.
There seems to be increased interest in using variables as variable
names [1,2], so it might be useful to expand 7.21 a little. Can an R
FAQ entry link to R-intro
2010 Nov 09
2
Creating a list to store output objects from a recursive loop
Dear Group,
I am having a function that I am running in a loop that generated two
results for each loop
The result1 is a zoo object
The result2 is a data frame
Now I want to put both of them in a list or some structure ... that I can
access or output to a file after the loop is done.
For e.g.
for (i in 1:20){
niceFunction(x[i],i)
}
niceFunction (x,i) {
result1 = someOperations() #zoo
2006 Apr 21
5
Simple Question: How to merge SQL results?
Hopefully an easy one, how do I merge two or more SQL query results?
Example:
result1 = find_by_sql(x)
result2 = find_by_sql(y)
What is the best way to merge result1 and result2? I want to be able
to reference the objects as if they were obtained via one query.
Cheers,
Dan
2009 Aug 10
0
Speeding up a bootstrap routine
I have written the R code below to perform White's Data Mining Reality Check
(DMRC) but as it stands at the moment it is painfully slow. It is written as
a function as I call it many times from a script file with different data
input, and the output is sunk() to a text file. Could anyone suggest
improvements to the code to increase its speed?
boot_white_test <- function(data) {
2009 Oct 15
1
tapply() and using factor() on a factor
Dear List,
Shouldn't result1 and result2 be equal in the following case?
Note that log$RequestID is a factor. That is, is.factor(log$RequestID)
yields TRUE.
result1 <- tapply(log$Flag,factor(log$RequestID),sum)
result2 <- tapply(log$Flag,log$RequestID,sum)
Yet, when I summarize the output, I get the following:
summary(result1)
Min. 1st Qu. Median Mean 3rd Qu.
2013 Sep 24
2
[LLVMdev] LLD: Returning true on success
On Sep 24, 2013, at 4:07 PM, Sean Silva <chisophugis at gmail.com> wrote:
> On Tue, Sep 24, 2013 at 4:17 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
> On Sep 24, 2013, at 12:40 PM, Michael Spencer <bigcheesegs at gmail.com> wrote:
>
>> On Tue, Sep 24, 2013 at 12:33 PM, Rui Ueyama <ruiu at google.com> wrote:
>> Hi LLD developers,
>>
2013 Sep 24
0
[LLVMdev] LLD: Returning true on success
On Tue, Sep 24, 2013 at 4:17 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
> On Sep 24, 2013, at 12:40 PM, Michael Spencer <bigcheesegs at gmail.com>
> wrote:
>
> On Tue, Sep 24, 2013 at 12:33 PM, Rui Ueyama <ruiu at google.com> wrote:
>
>> Hi LLD developers,
>>
>> I'm about to make a change to invert the return value of Driver::parse()
2007 Aug 12
5
stubbing a method that yeilds sequential results
I''ve just found myself stuck trying to rspec something so am hoping
someone more knowledgable can help.
I have a Connector class which has a class method ''results'' that
yields results it get from a network service based on a set of
attributes that I pass to it. I am wanting to yield these results
from my Intermediate class up to the next
2013 Sep 25
0
[LLVMdev] LLD: Returning true on success
On Tue, Sep 24, 2013 at 4:44 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
> On Sep 24, 2013, at 4:07 PM, Sean Silva <chisophugis at gmail.com> wrote:
>
> On Tue, Sep 24, 2013 at 4:17 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
>>
>> On Sep 24, 2013, at 12:40 PM, Michael Spencer <bigcheesegs at gmail.com>
>> wrote:
>>
>>
2006 Sep 22
2
foo.expects(:blah).returns(10).then(11) syntax
I recently needed the behavior of my object to change on subsequent
method calls so I added the syntax above.
Here''s the diff of changes I made:
Index: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 854)
+++ test/mocha/expectation_test.rb (working copy)
@@ -95,6 +95,12 @@
2010 Jan 21
1
why scores are different in rda() and princomp()
hello,
I am doing PCA in R using some habitat factors, and I used the function result1=rda() and result2=princomp(),then pick up scores of the result1 and result2 using scores(),but the scores are significantly different,i do not know the meaning of it.
Best wishes!
Cheng
2010 Apr 30
2
deriving mean from specific cases
Hi all,
I have a large dataset that has >10k entries. The dataset is stored in a
dataframe with the headers:
SubID Condition1 Condition2 Result1 Result2
There are multiple entries for a given SubID(Subject ID). Condition 1 has 3
levels and condition2 has 2 levels (therefore there are 6 possible
combinations all together e.g. Cond1 Level1 x Cond2 Level 1 etc.) and i need
to compute for
1. The
2011 Mar 11
1
Generation of random numbers in a function - (Return command)
Dear R helpers
I have following data.frame and for each product_name, I have associated mean and standard deviation. I need to generate 1000 random no.s for each of these products and find the respective mean and standard deviation.
My R code is as follows.
library(plyr)
library(reshape2)
filtered_new <- data.frame(product_name = c("P1", "P2", "P3",
2009 Feb 23
3
[LLVMdev] Broke my tail (call)
On Mon, Feb 23, 2009 at 2:13 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> Moreover, I now have evidence that LLVM is not behaving as you expect:
>
> 3. Adjusting the return value from this function into sret form results in
> tail call elimination being performed correctly. Note that this is still
> passing a first-class struct by value as an argument to a function
2007 Nov 26
3
Time Series Issues, Stationarity ..
Hello,
I am very new to R and Time Series. I need some help including R codes
about the following issues. I' ll really appreciate any number of
answers...
# I have a time series data composed of 24 values:
myinput = c(n1,n2...,n24);
# In order to make a forecasting a, I use the following codes
result1 = arima(ts(myinput),order = c(p,d,q),seasonal = list(order=c(P,D,Q)))
result2 =
2015 Sep 03
2
dhcp errors - Re: dhcp example
First I am having a couple challenges with your script here:
On 09/03/2015 02:43 PM, Rowland Penny wrote:
>
> I thought that might be your next question, I wrote it, based on what
> I found here:
>
> http://blog.michael.kuron-germany.de/2011/02/isc-dhcpd-dynamic-dns-updates-against-secure-microsoft-dns/
>
>
> #!/bin/bash
>
> # /usr/local/sbin/dhcp-dyndns.sh
> #
2005 Jun 08
2
Robustness of Segmented Regression Contributed by Muggeo
Hello, R users,
I applied segmented regression method contributed by Muggeo and got
different slope estimates depending on the initial break points. The results
are listed below and I'd like to know what is a reasonable approach handling
this kinds of problem. I think applying various initial break points is
certainly not a efficient approach. Is there any other methods to deal with
segmented
2012 Sep 20
3
lattice dotplot reorder contiguous levels
my reproducible example
test<-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), .Label = c("A",
"B", "C", "D", "E"), class = "factor"),
2006 Jul 24
2
persistent C++ objects
Hi,
I am trying to create an R interface for Dynare++ [1], a k-order
solver for rational expectation models. I would like some advice on
how to glue the C++ code to R.
In C++, it works the following way:
- a DynareModelEq object is initialized with the formulas, parses them
and performs k-order symbolic expansions
- the user calls a member of this object multiple times with parameter