Displaying 20 results from an estimated 2000 matches similar to: "syntax with do.call and `[`"
2011 Aug 01
4
fill Matrix quicker
dear all,
i have a quite simple question, i want to fill up a Matrix like done in the
following function,
but the performance is very bad for large dimensions
is there a way to do this like with apply or something similar?
makeMatrix <- function(a, b,dim) {
X=matrix(0,ncol=dim,nrow=dim)
for (i in c(1:dim)){
for (j in c(1:dim)) {
if (i==j) {X[i,j]<-a}
else { X[i,j]<- exp((
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
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
2013 Sep 24
3
[LLVMdev] LLD: Returning true on success
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() to return true on success. Currently it returns false on success.
>
> In many other functions, we return true
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,
>>
2011 Nov 15
3
Create a function with multiple object as an output
I've seen some questions regarding the output of multiple objects from a
function, however the suggestions all end up suggesting the use of
return(list(result1=result1, result2=result2 , result3=result3)).
How can I return multiple objects that are 2 big to be added to a list?
--
View this message in context:
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.
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 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()
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:
>>
>>
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
2009 Apr 02
2
finding best fitting model
Hello,
Is there a function in r to find the best fitting model for a set of data?
I would like to know if my data are related exponentially,linearly or if there is a logarithmic correlation between my x and y values.
To get a better imagination I've added the graphics at the end of this mail
as an attachment.
Thanks, Ben
--
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
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 @@
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",
2015 Sep 03
7
samba_dlz: Failed to connect
On Thu, 3 Sep 2015, Rowland Penny wrote:
> What are the permissions on /var/lib/samba/private/dns ?
Also don't forget the permissions on /var/lib/samba/private
If you're using sernet's packages, you'll have to chgrp it to to named or give
it o+x perms.
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
2011 Sep 09
3
get mean from cdf
Hi All,
How can I get the expected value from a discrete cdf? Is there any R
function that can do this?
Thanks,
Annie
[[alternative HTML version deleted]]
2011 Sep 10
1
Variable name with a '-'
My statistics teacher wrote a textbook and included .rdata files for the
problem set data. I downloaded these and opened one of them up. Then I used
the ls() command, and it gave me this:
> ls()
[1] "ex02-12"
However, when i try to use the object, it interprets it as ex02 - 12, and I
get the following error:
> ex02-12
Error: object 'ex02' not found
I don't know why
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 =