search for: mysums

Displaying 20 results from an estimated 22 matches for "mysums".

Did you mean: mysum
2006 Mar 09
1
Linking Rblas
Dear all, when making a DLL via Rcmd SHLIB is there a way to link against a library such as Rblas (I am on a Windows platform) on a case to case basis? I played a bit around with some self-written C-code which should call the function 'dasum' defined in Blas.h. I encountered the following problem: u:\codeplay>Rcmd SHLIB mysumming.c Rcmd SHLIB mysumming.c gcc --shared -s -o
2011 Nov 20
2
Adding two or more columns of a data frame for each row when NAs are present.
I am fairly new to R and would like help with the problem below. I am trying to sum and count several rows in the data frame yy below. All works well as in example 1. When I try to add the columns, with an NA in Q21, I get as NA as mySum. I would like NA to be treated as O, or igored. I wrote a function to try to count an NA element as 0, Example 3 function. It works with a few warnings,
2006 Mar 09
0
Linking Rblas [under Windows]
Dear Prof. Ripley, thank you very much. It works now absolutely fine using a "Makevars" file with the contents you suggested. Thanks again, Roland > -----Original Message----- > From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] > Sent: Thursday, March 09, 2006 12:09 PM > To: Rau, Roland > Cc: r-help at stat.math.ethz.ch > Subject: Re: [R] Linking Rblas
2003 Dec 10
0
dyn.load for c code
I am learning how to load C code into R-1.8.0 on Windows 98. To this end I wrote a small c program, downloaded the tools, perl, and mingw on the "building R for windows" page, and proceeded to create libR.a & libRblas.a as explained in the readme.packages. I started with a simple c program called mysum.c that can be found on:
2013 Jan 16
1
How to call Java main method using rJava package?
Hi, I am trying to integrate my Java program with R using rJava package. I want to execute the whole Java program from R. The main() method in my Java code calls all the other defined methods. So, I guess I have to call the main() method in .jcall. An example Java code: *class A { public static int mySum(int x, int y) { return x+y; } public static void
2007 Jun 28
3
Function call within a function.
I am trying to call a funtion within another function and I clearly am misunderstanding what I should do. Below is a simple example. I know lstfun works on its own but I cannot seem to figure out how to get it to work within ukn. Basically I need to create the variable "nts". I have probably missed something simple in the Intro or FAQ. Any help would be much appreciated. EXAMPLE
2011 Nov 10
3
optim seems to be finding a local minimum
Hello! I am trying to create an R optimization routine for a task that's currently being done using Excel (lots of tables, formulas, and Solver). However, otpim seems to be finding a local minimum. Example data, functions, and comparison with the solution found in Excel are below. I am not experienced in optimizations so thanks a lot for your advice! Dimitri ### 2 Inputs:
2007 Dec 07
4
Using R function in Excel
Does anyone know a way that an function written in R can be called within a cell of an Excel spreadsheet. I would like to use the R function much as I use the native Excel functions, e.g. instead of using the excel function sum, =sum(A2,A6), I would like to use the function mysum written in R, e.g. =mysum(A2,A6). Thanks, John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics
2011 Mar 30
3
optim and optimize are not finding the right parameter
Dear all, I have a function that predicts DV based on one predictor pred: pred<-c(0,3000000,7800000,15600000,23400000,131200000) DV<-c(0,500,1000,1400,1700,1900) ## I define Function 1 that computes the predicted value based on pred values and parameters a and b: calc_DV_pred <- function(a,b) { DV_pred <- rep(0,(length(pred))) for(i in 1:length(DV_pred)){ DV_pred[i] <- a *
2005 Apr 15
4
function corresponding to map of perl
Is there a function in R that corresponds to the function ``map'' of perl? It could be called like: vector.a <- map( vector.b, FUN, args.for.FUN ) It should execute for each element ele.b of vector.b: FUN( vector.b, args.for.FUN) It should return a vector (or data.frame) of the results of the calls of FUN. It nearly works using: apply( data.frame( vector.b ), 1, FUN,
2006 Jun 01
4
A coding question
Dear List: I have the follow code: y <- replicate(10,replicate(8,sum(rnorm(rpois(1,5))))) Now I need to apply the following condition to _every_ randomly generated Normal number in the code above: x - max(0,x-15) + max(0,x-90), where x represents the individual Normal numbers. In other words, the said condition needs to be applied before replicate(...(replicate(...(sum(...))) takes place.
2009 Mar 08
3
Thread creation in Wine
Hi guys, I was looking at the thread creation API. Exactly, why do we use PTHREAD_SCOPE_SYSTEM instead of PTHREAD_SCOPE_PROCESS ? http://source.winehq.org/git/wine.git/?a=blob;f=dlls/ntdll/thread.c#l611 What is the technical difference? I remember, some years ago, that on SunOS 8 setting the latter it would make one thread only scheduled globally for the process, instead, using the first would
2008 Dec 07
5
How to force aggregate to exclude NA ?
The aggregate function does "almost" all that I need to summarize a datasets, except that I can't specify exclusion of NAs without a little bit of hassle. > set.seed(143) > m <- data.frame(A=sample(LETTERS[1:5], 20, T), B=sample(LETTERS[1:10], 20, T), C=sample(c(NA, 1:4), 20, T), D=sample(c(NA,1:4), 20, T)) > m A B C D 1 E I 1 NA 2 A C NA NA 3 D I NA 3 4 C I
2009 Jul 14
1
Incorrect comment about ISNA(x) in Arith.h (PR#13826)
R-2.9.0/include/R_ext/Arith.h has: int R_IsNA(double); /* True for R's NA only */ int R_IsNaN(double); /* True for special NaN, *not* for NA */ int R_finite(double); /* True if none of NA, NaN, +/-Inf */ #define ISNA(x) R_IsNA(x) /* True for *both* NA and NaN. The first and last lines are contradictory - if R_IsNA is true only for NA, not NaN, then ISNA should be the same.
2006 Oct 30
2
[LLVMdev] "fork" and "sync" for LLVM thread support - any comments?
Dear all, Recently I've wanted to add support for threads to LLVM (motivated by OpenMP, more or less), but before jumping in and implementing anything, I thought it might be a good idea to describe what I have in mind and ask for comments. Hence this email - if anyone has any comments, I'd be very glad to hear them. WHAT I'M PROPOSING: The addition of two instructions - fork
2011 Dec 26
4
Summary tables of large datasets including character and numerical variables
Hello ! I am attempting to switch from being a long time SAS user to R, and would really appreciate a bit of help ! The first thing I do in getting a large dataset (thousands of obervations and hundreds of variables) is to run a SAS command PROC CONTENTS VARNUM command - this provides me a table with the name of each variable, its type and length; then I run a PROC MEANS - for numerical
2007 Oct 01
3
mean of subset of rows
Dear list, this must be an easy one: I have a data.frame of two columns, "ID" with four different levels (A to D) and numerical "size", and each of the 4 different IDs is repeated a different number of times. I would like to get the mean size for each ID as another data.frame. I have tried the following: >ID= as.character(unique(data[,1])) # I use unique() because
2010 Jun 03
1
[LLVMdev] call a extern C function
How can i interface llvm bitcode with a existent so library... like when you use C prebuilt cos() or sin() ... suppose that i create a sum() in c/c++ compile a .so lib with it and call it from "the bitcode" program... how can i do this? Thanks Fabio Kaminski -------------- next part -------------- An HTML attachment was scrubbed... URL:
2004 May 10
2
Lists and outer() like functionality?
Hi, I'm have a list of integer vectors and I want to perform an outer() like operation on the list. As an example, take the following list: mylist <- list(1:5,3:9,8:12) A simple example of the kind of thing I want to do is to find the sum of the shared numbers between each vector to give a result like: result <- array(c(15,12,0,12,42,17,0,17,50), dim=c(3,3)) Two for() loops is the
2004 Sep 26
2
Sweave: superfluous newline (`\\') in tex file
Hi, I'm having trouble sweaving the following example: --8<------------------------schnipp------------------------->8--- \documentclass{article} \begin{document} \SweaveOpts{echo=FALSE} @ <<>>= rm(list=c(ls())) library(Hmisc) library(ISwR) data(energy) energy$log <- log(energy$expend) attach(energy) @ %def @ <<results=tex>>= mysum <- summary(stature ~