similar to: How do I make proper use of the by() function?

Displaying 20 results from an estimated 500 matches similar to: "How do I make proper use of the by() function?"

2002 Apr 20
2
integration of a discrete function
Dear R list I am looking for a function in R that computes the integration of a discrete curve, such as a power spectrum, in a specified interval (in my case, that would be 'power in a certain frequency band'). I found only functions, such as 'integrate', that perform adaptive quadrature on analytic functions, and not on a curve specified as a set of (x,y) pairs. I have the
2004 Oct 26
2
integration problem
Dear R users, I have spectral data (say, wavelength vs. extinction coefficient) for which I??d like to calculate an integral (i.e. the area underneath the curve). Suppose the (artificial) dataset is lambda E 1 2 2 4 3 5 4 8 5 1 6 5 7 4 8 9 9 8 10 2 How can I calculate an integral for these values using R? Many thanks for any help! Regards Christoph
2006 Jul 19
3
Fitting a distribution to peaks in histogram
Hello list! I would like to fit a distribution to each of the peaks in a histogram, such as this: http://photos1.blogger.com/blogger/7029/2724/1600/DU145-Bax3-Bcl-xL.png . The peaks are identified using Petr Pikal peaks function ( http://finzi.psych.upenn.edu/R/Rhelp02a/archive/33097.html), but after that I am quite stuck. Any idea as to how I can: Fit a distribution to each peak Integrate the
2012 Dec 14
5
A question on list and lapply
Dear all, let say I have following list: Dat <- vector("list", length = 26) names(Dat) <- LETTERS My_Function <- function(x) return(rnorm(5)) Dat1 <- lapply(Dat, My_Function) However I want to apply my function 'My_Function' for all elements of 'Dat' except the elements having 'names(Dat) == "P"'. Here I have specified the name
2011 May 04
3
Error in .Fortran Call
I have the following FORTRAN code converted to a DLL: ! my_xmean.f90 ! ! FUNCTIONS/SUBROUTINES exported from my_function.dll: ! my_function - subroutine ! subroutine my_xmean(X,N,XMEAN) ! Expose subroutine my_function to users of this DLL ! !DEC$ ATTRIBUTES DLLEXPORT,C,REFERENCE,ALIAS:'my_xmean_'::my_xmean ! Body of my_function DOUBLE PRECISION X(N) XMEAN=0D0 DO J=1,N
2008 Aug 19
7
[LLVMdev] Please help with LLVM C++ integration
Hi Gordon, I wrote a small example, but while running I get an error("Tied to execute an unknown external function"), where I am wrong? Thanks in advance. Kirill. int some_test_func( int ){ std::cout << "!!!!" << std::endl; return 8848; } int _tmain(int argc, _TCHAR* argv[]){ Module *M = new Module("test"); ExistingModuleProvider* MP = new
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi, # For publications, I am not allowed to repeat the axes. I have tried to remove the axes using: # yaxt="n", but it did not work. I have not understood how to do this in ggplot2. Can you help me? # I also do not want loads of space between the graphs (see below script with Dummy Data). # If I could make it look like the examples on the (nice) examples page: #
2013 Mar 07
3
ggpliot2: reordering of factors in facets facet.grid(). Reordering of factor on x-axis no problem.
Hi everyone (again), before you all start screaming that the reordering of factors has been discusse on several threads and is not particular to ggplot2, hear me out. I can easily reorder my x-axis factor in facet.grid() in ggplot2. What I cannot reorder are the factors represented on the strips. I can see that the graphs are changing, so I am afraid of what it is I am doing. Why is ggplot2
2019 Jun 29
2
storage class 0 symbol is generated for a double constant in COFF-x86-64 object file
Hi, I am using the llvm codegen facility (version 7.0.1) to translate LLVM IR for different platforms. I have this error particularly in win64 platform. In my IR code I have such code snippet: %50 = call i8* @my_function(i8* %48, double 2.000000e+00, double 2.000000e+00) ... declare dllimport i8* @my_function(i8*, double, double) By passing it to llc.exe, I find following symbol is declared in
2006 Jun 07
3
function to be used in model
Where is the best place to put a function that will be used in both several controller and several models? -- Posted via http://www.ruby-forum.com/.
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A 11/12/2009 4 B 11/11/2009 7 B 11/13/2009 8 >From that I need to generate all permutations of Factor1 and Factor2 and force a 0 for any combination that doesn?t
2019 Jul 02
2
storage class 0 symbol is generated for a double constant in COFF-x86-64 object file
Hi Reid, Sure. Here I attach the trimmed IR(sim_0.ll) which llc.exe takes and produces a 0 storage class symbol. The IR is fairly long but there is only 1 usage of real constant as actual argument passing to function iki_vlog_time() at line 137. The version of llc.exe is $ llc.exe --version LLVM (http://llvm.org/): LLVM version 7.0.1 DEBUG build. Default target: x86_64-pc-win32 Host
2011 Jan 27
3
how to divide each element of a matrix by a specific value per column
Hi, I'd like to divide each element of a matrix by a specific value per column. These specific values are stored in a list. For example: > x <- c(1,2,3,4,5) > y <- matrix(c(1:30), nrow = 6) Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have tried this > my_function <- function(data, ind) data/ind > apply(y, 2, my_function, x) [,1] [,2]
2010 Jan 11
1
apply a function down each column
Hello World, I have a function that makes pairwise comparisons between two strings. I would like to apply this function to my data (which consists of columns with different strings) in the way that it compares the first with the second entry, and then the third with the fourth, and then the fifth with the sixth, and so on down each column... So (2x-1) and (2x) would be the different entries to be
2003 Mar 06
6
type III Sum Sq in ANOVA table - Howto?
Hello, as far as I see, R reports type I sums of squares. I'd like to get R to print out type III sums of squares. e.g. I have the following model: vardep~factor1*factor2 to get the type III sum of squares for factor1 I've tried anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2)) but that didn't yield the desired result. Could anyone give me a hint how to proceed?
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
Hi Kirill, Don't forget to add X86TargetMachine.obj (add to Additional Dependencies in Linker options, if you are using MSVS) otherwise LLVM will try and use Interpreter instead of JIT. Hope this helps, Rob. > -----Original Message----- > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On Behalf Of kirill havok > Sent: Wednesday, August 20, 2008
2005 Oct 13
1
Problem whit a piece of program
Hi friends, I'm beginning in R and I have simple question. I have this piece of my program and how you see, that's ok (whit > num<- 0.002) num<-0.002 # ok, but not when I change whit num<-0... ? factor1<-1; while(1) { if (num*factor1<1) factor1<-factor1*10 else { print("out ok!!"); break; } } [1] "out ok!!" but when I change (whit >
2002 Nov 29
2
Obtaining the variable names of a glm object
Is names(model1$coef) what you're looking for? -----Original Message----- From: Kenneth Cabrera [mailto:krcabrer at epm.net.co] Sent: 29 November 2002 10:36 Cc: R-help at stat.math.ethz.ch Subject: [R] Obtaining the variable names of a glm object Hi, R users! Suppose I make a model like this:
2008 Aug 19
0
[LLVMdev] Please help with LLVM C++ integration
kirill havok wrote: > Hi Gordon, > I wrote a small example, but while running I get an error("Tied to > execute an unknown external function"), where I am wrong? > I think the problem is that some_test_func() is a C++ function, so its name is being mangled during compilation. To fix it, I think you want to add a declaration telling the compiler to treat some_test_func()
2004 Jul 29
2
aov for unbalanced design (PR#7144)
Full_Name: Tanya Logvinenko Version: 1.7.0 OS: Windows 2000 Submission from: (NULL) (132.183.156.125) For unbalanced design, I ran into problem with ANOVA (aov function). The sum of squares for only for the second factor and total are computed correctly, but sum of squares for the first factor is computed incorreclty. Changing order of factors in the formula changes the ANOVA table. For the