Displaying 20 results from an estimated 44 matches for "function1".
Did you mean:
function
2012 Jul 30
6
Convert variable to STring
Dear all,
I have a variable that I would like also to use it as a string. The reasons is that I want to collect results from different function to one table.. So when I use the
colnames(mymatrix) <-c(function1.function2,function3)
the function1, function2, function3 to be "converted" to simple strings so as
colnames(mymatrix) <-c("function1","function2","function3")
Could you please help me understand how I can do that in R?
Regards
[[alternative HTML vers...
2012 Feb 09
3
calling the function which is stored in a list
Hi
I'm storing two functions in a list
# creating two function
function1 <- function(n) {
return(sum(n))
}
function2 <- function(n) {
return(mean(n))
}
#storing the function
function3 =c(function1,function2)
is it possible to call the stored function and used it ?
x=c(10,29)
funtion3[1](x)
Thanks
-----
Thanks in Advance
Arun
--
View this messag...
2008 Apr 22
2
optimization setup
Hi, here comes my problem, say I have the following functions (example case)
#------------------------------------------------------------
function1 <- function (x, theta)
{a <- theta[1] ( 1 - exp(-theta[2]) ) * theta[3] )
b <- x * theta[1] / theta[3]^2
return( list( a = a, b = b )) }
#-----------------------------------------------------------
function2<-function (x, theta)
{P <- function1(x, theta)
c <- P$a * x * exp(-...
2007 Jun 14
1
Using subset() in a user-defined function
Hello,
I'm having a problem with using subset() inside a function I'm writing.
Ignoring everything else in the function, the problem can be illustrated
by (where master.frame is the data frame I'm using):
function1 <- function(arg1="", arg2="", arg3=""){
temp.frame <- subset(master.frame, a == arg1 & b == arg2 & c ==
arg3)
}
This works fine if the user specifies all arguments, but if any one or
more of the arguments isn't specified, say arg1 for example, th...
2009 Dec 22
1
[LLVMdev] is there a compiler barrier that is effective at codegen level?
...; <i64> [#uses=5]
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags},~{memory}"()
nounwind
%fp73 = call i8* @llvm.frameaddress(i32 0) ; <i8*> [#uses=1]
%sp74 = call i8* @llvm.stacksave() ; <i8*> [#uses=1]
call fastcc void @Function1(i8* %sp74, i8* %fp73) nounwind
%162 = call i32 (i32, ...)* @Function2(i32 0) ; <i32> [#uses=1]
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags},~{memory}"()
nounwind
In particular, I would like to prevent modifications to the stack to be put
between th...
2006 Apr 17
4
R debugging options
Hello,
What options are available for me to debug my R scripts? For example I
normally do something like
>source("myfunctions.R")
>function1("height", "weight")
myfunctions.R is a large R source file that contains many functions. function1
is the "main" function in myfunctions.R. It calls many other user-written
functions that are also in myfunctions.R.
I only want to debug the R scripts. I do not need...
2005 Apr 26
2
C++ <-> R mapping
Following my previous post and the intuitive adivces of Duncan Murdoch, I
would like to ask some questions regarding C++ to R mapping.
Initially, it appeared to me that in order to perform this mapping, the
existing object-oriented design of R would be a good choice. This could
include both the S3 and S4 classes approaches. However, there were replies
about some 'other' approaches. I
2006 Oct 09
0
dispatch on functions (was: Re: ifelse(logical, function1, function2) does not work)
On 10/7/06, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> I have noticed that dispatch on functions seems not to work
> in another case too. We define + on functions (I have ignored
> the niceties of sorting out the environments as we don't really
> need it for this example) but when we try to use it, it fails even
> though in the second example if we run it
2014 Jun 11
3
[LLVMdev] How do clang & clang++ choose function names for LLVM IR?
Hello all,
I'm getting started on a project using LLVM's opt tool to do static
analysis, printing call graphs and such. When compiling C programs to IR
(and eventually to call graphs), function names remain the same (main,
function1, function2 etc.), but when compiling the same program as C++, the
function names often have cruft added to them (_Z9function1v, _Z9function2v
etc.) which doesn't make for a very pretty graph.
Why are these extra characters added when going to IR from C++, but not C?
I'm interested in what...
2006 Oct 07
3
ifelse(logical, function1, function2) does not work
Why this kind of assignment does not work?
n <- 1
f <- ifelse(n == 1, sin, cos)
f(pi)
this must be rewritten as:
n <- 1
f <- cos
if (n == 1) f <- sin
f(pi)
[oops. 1.224606e-16 instead of zero. Damn floating point errors :-/]
Alberto Monteiro
2009 Dec 03
2
Error in namespaceExport(ns, exports) :
Dear all,
I get the error
"Error in namespaceExport(ns, exports) :
undefined exports function1 , function2"
when compiling or even when I roxygen my package. The two function I once
had in my package but I deleted them including their .Rd files. I also can't
find them in any other function or help file.
So does anybody know where these functions are still listed that causes this
e...
2009 Dec 03
2
Error in namespaceExport(ns, exports) :
Dear all,
I get the error
"Error in namespaceExport(ns, exports) :
undefined exports function1 , function2"
when compiling or even when I roxygen my package. The two function I once
had in my package but I deleted them including their .Rd files. I also can't
find them in any other function or help file.
So does anybody know where these functions are still listed that causes this
e...
2008 Feb 20
1
Problem Using the %in% command
Hello all!
I have the following problem with the %in% command:
1) I have a data frame that consists of functions (rows) and genes
(columns). The whole has been loaded with the "read.delim" command
because of gene-duplications between the different rows.
2) Now, there is another data frame that contains all the genes (only
the genes and without duplicates) from all the functions of
2008 Mar 19
1
Radio Buttons or similars
Hello companions!!!
I have a function that creates a Radio Buttons, and I need that this
function return the selected value in the Radio Buttons. I would like that,
if somebody know as I could return the value, you say me as do it.
Next, I show the function
function1<-function(){
require(tcltk)
tt <- tktoplevel()
rb1 <- tkradiobutton(tt)
rb2 <- tkradiobutton(tt)
rbValue <- tclVar("oranges")
tkconfigure(rb1,variable=rbValue,value="apples")
tkconfigure(rb2,variable=rbValue,value="oranges")
tkgrid(tklabel(tt,tex...
2012 Oct 05
2
Using variables from different environments in one function
...-community,
I have been experiencing this issue with functions within a function and
I can kind of feel where the problem is (environments, closures etc),
but I don't manage to solve it.
I will sketch it with an example:
#We have two simple "inner" functions:
############## INNER FUNCTION1 #################
innerfunction1<-function()
{
ab<-a+b
cd<-c+d
innerfunctionlist<-list("ab"=ab,"cd"=cd)
}
################################################
############## INNER FUNCTION2 #################
innerfunction2<-function()
{...
2007 Jul 31
1
Getting variable name used in function...
...could not give different file names) and I would like to get object name. Is it possible to get data object's name. And if it is possible, how can I assign this name as an new data object name with an extra addition, for example, data objects name+"2".
Thanks for your help.
Example:
function1(var1,var2)
function2(var1)
function2(var2)
...
With my best regards,
Levent TERLEMEZ.
[[alternative HTML version deleted]]
2009 May 25
0
Or operator on working on the r-objects doesn't generate a logical value
Hi friends,
Can somebody help me out please?
I have to create a string for a particular if condition , with some
values(returned by function1) which are always variable.
*Step-I* Suppose function1 returns a dataframe like this,shown below with
two values 3 and 4:---
x
1 3
2 4
*STEP-II *For creating the string with these values returned by function 1
i have another function2.
These values when passed to function 2 ,returns somethi...
2013 Aug 21
1
cyclic namespace dependency detected when loading ...
Hi R users,
I am developing two packages. Each package uses some functions from the
other package. Now when I define these dependencies in the NAMESPACE
file (via importFrom(XXXX,function1,....)), i get this error (when
building one package):
cyclic namespace dependency detected when loading 'XXXXXX', already
loading ?YYYYYYY?, ?XXXXXXXXX?
Is there any way to prevent this error? Shouldn't this case be allowed
in some way? Or can package dependencies only be in one di...
2015 Aug 26
2
declaring dependencies of shiny app in inst/
...ystem.file("inst/..."))
However, the app itself uses functions from packages which are not used elsewhere in the code. What is the best way to declare these dependencies (using roxygen2)? My 2-cents would be e.g a doc.R file with something along the lines of:
[...]
#' @importFrom pkg function1 function2
NULL
But are their better ways / best practices?
On a related topic: are there plans of formally incorporating shiny apps in the structure of a R package, so that the checks will run through the code of the apps as well?
Cheers
Thibaut
==============================
Dr Thibaut Jombar...
2006 Mar 24
5
problems with ".this"
Hello I´m making a class using prototype''s class.create(), like this:
var onewClass = Class.create();
onewClass.prototype = {
initialize : function(array) {
this.variable = "fooo";
this.array = array;
},
function1 : function() {
this.array.each(function(element){
alert(element);
alert(this.variable);
});
}
};
and I intance it like this:
var array = ("house", "car", "tree");
var newClass = new onewClass(...