similar to: Apply function to column of array

Displaying 20 results from an estimated 20000 matches similar to: "Apply function to column of array"

2002 Nov 06
1
Aggregating a List
Hi all, There must be a really obvious R solution to this, but I can't figure out how to aggregate a list. For instance, if I read.table the following from a file: Val1 Val2 A 3 4 A 5 6 B 4 4 I would like to take the mean (or median) across any/all rows of type "A" to end up with the structure: Val1 Val2 A 4 5 B 4 4 in this case. How would I go about doign that w/o doing a
2003 Jul 10
2
Version Number of a Package
Hello, Apologies if this is a stupid question. I googled and skimmed the archives and didn't see anything specific about this. I am documenting an analysis procedure in a DB and I would like to know the specific version number of each package that I use. Is there a standardized way of getting that information out from R, or should I parse it out from the source-code files? Ideally I
2003 Jan 14
4
density plot - beginner's question
Hi, I am trying to plot densities given on a two dimensional grid. My data is in the an external file, and is arranged in three columns: x, y, density how may i get a plot of this? i would like to get (1) a three dimensional plot and (2) a color coded two dimensional plot. I have tried using image(x, y, density) but i am asked to put the data in ascending order. i am not sure how i may
2010 Nov 11
2
[LLVMdev] defining types structurally equivalent to a recursive type
Hi all, http://www.llvm.org/docs/ProgrammersManual.html#BuildRecType suggests us to define recursive types via opaque and refine. Since LLVM has structural types, %rt = type { %rt* } and %rt1 = type { %rt* } should be same structurally. I tested the following code, %rt = type { %rt* } %rt1 = type { %rt* } define i32 @main() nounwind { entry: %0 = alloca %rt ;
2010 May 04
3
Kernel density estimate plot for 3-dimensional data
Hi! I have a problem with Kernel density estimate plot for 3-dimensional data in ks-package. Here the example: # load ks, spatstat # three-dimensional kernel density of B B <- pp3(runif(300), runif(300), runif(300), box3(c(0,1))) x <- unclass(B$data)$df H <- Hpi(x) fhat <- kde(x, H=H) plot(fhat) plot(fhat, axes=FALSE, box=FALSE, drawpoints=TRUE);
2010 Nov 19
1
Sampling from multi-dimensional kernel density estimation
Hi, I'd like to use a three-dimensional dataset to build a kernel density and then sample from the distribution. I already used the npudens function in the np package to estimate the density and plot it: fit<-npudens(~x+y+z) plot(fit) It takes some time but appears to work well. How can I use this to evaluate the fitted function at a certain point, e.g. (x=1, y=1, z=1)?
2010 Nov 11
0
[LLVMdev] defining types structurally equivalent to a recursive type
On Thu, Nov 11, 2010 at 8:28 AM, Jianzhou Zhao <jianzhou at seas.upenn.edu> wrote: > Hi all, > > http://www.llvm.org/docs/ProgrammersManual.html#BuildRecType suggests > us to define recursive types via opaque and refine. Since LLVM has > structural types, %rt = type { %rt* } and %rt1 = type { %rt* } should > be same structurally. I tested the following code, > > %rt =
2007 Nov 26
2
2d Joint Density Plot
Hi all, I'm fairly new to R, so I'm still trying to feel out what is available to me. I would like to be able to plot joint density in a two dimensional plot where density is indicated by color or darkness gradients, like a 2d color coded topographic map. Ideally, the output would be something I could then plot other points or lines on. Currently, I'm calculating joint density with
2012 May 14
3
How to apply a function to a multidimensional array based on its indices
Hello. I have a 4 dimensional array and I want to fill in the slots with values which are a function of the inputs. Through searching the forums here I found that the function "outer" is helpful for 2x2 matrices but cannot be applied to general multidimensional arrays. Is there anything which can achieve, more efficiently than the following code, the job I want? K <-
2010 Oct 01
2
How to apply vector value function to a multidimensional array indexed by the remaining dimensions?
Hi, I am looking for some generalization of colSums and rowSums for general vector valued functions, and for arrays of more than 2 dimensions. So as a concrete example, suppose I have a 3 dimensional array, given by x = array(1:100,c(3,4,5)). and I want to sum the 3rd index of x to obain a 3 by 4 matrix. Using rowSums would return a vector of length 3 because it treats the last two indices as
2003 Nov 01
2
Question about the high dimensional density estimation
Hi, I found that the R package "KernSmooth" can deal with only 1D and 2D data. But now I have a collection of 4-dimensional data (x1,x2,x3,x4) and would like to estimate the "mode" of the underlying density. What can I do about it ? Thanks a lot. -- Ying-Chao Hung Assistant Professor Graduate Institute of Statistics National Central University Chung-Li, Taiwan TEL:
2017 Oct 08
2
how to overlay 2d pdf atop scatter plot using ggplot2
Note: I have posted this on SO also but while the question has been upvoted, there has been no answer yet. https://stackoverflow.com/questions/46622243/ggplot-plot-2d-probability-density-function-on-top-of-points-on-ggplot Apologies for those who have seen it there also but I thought that this list of experts may have someone who knows the answer. I have the following example code:
2005 Sep 29
2
solution of convolution equation
Hello, May be somebody can help me... I am trying to find a solution of a convolution equation using fft (and unfortunately I do not have a good background for this). So I am just trying to figure out how it can be implemented in R. I have two multidimensional independent variables X and Z and I know their densities fx and fz, which are multidimensional arrays. So I have to find the density of
2004 Oct 21
5
Cluster Analysis: Density-Based Method
Hi people, Does anybody know some Density-Based Method for clustering implemented in R? Thanks, Fernando Prass _______________________________________________________
2012 Nov 28
1
Plot 3d density
I want to create a 3d plot with densities. I use the function density to first create a 2d dimensional plot for specific x values, the function then creates the density and puts them into a y variable. Now I have a second set of x values and put it again into the density function and I get a second set of y variables and so on.... I want to put those sets into a 3d plot, I hope you know what I
2006 Jan 19
2
function kde2d
Good evening, I am Marta Colombo, student at Milan's Politecnico. Thank you very much for your kindness, this mailing list is really useful. I am using the function kde2d for two-dimensional kernel density estimation and I'd like to know something more about this kind of density estimator. In particular I'd like to know: what bandwidth is used ? Thank you in advance for your attention
2009 May 28
3
R help
Dear Sir I am new user of R. I am interested in modeling hydrological extreme events. I found MSClaio2008 very interesting function. In this function four criterions for choosing distributions. Can we call these criterions as model selection techniques or goodness of fit techniques or both? Because goodness of fit techniques are usually performed after modle selection. Can I found
2006 Jan 05
3
Parsing key-value files
Hi, I am very very new to both Ruby and Ruby on Rails. I have been given a task to create a web application, which is able to edit individual entries in a key-value file. In other works, I would need to create an application which can parse a key-value file. Could someone guide me where I should start in a case like that? I was able to access and edit database table entries using Rails, but I
2002 Jul 29
1
density estimation on 2-D bounded domain
Dear R experts, density estimation on a 2 dimensional bounded domain --------------------------------------------------------------------- I am currently trying to estimate the probability density (PD) of cancers within the breast using the sm library with the routine sm.density Of course a practical PD must be limited by the curve of the breast outline. I don't have a clue after perusing
2017 Oct 09
2
example of geom_contour() with function argument
Can someone please point me to an example with geom_contour() that uses a function? The help does not have an example of a function, and also I did not find anything from online searches. TIA, BFD ----------------------------------------------------------------------------------------------- How about geom_contour()? Am So., 8. Okt. 2017, 20:52 schrieb Ranjan Maitra <maitra at