Displaying 20 results from an estimated 100 matches similar to: "Matrix interesting question!"
2011 Mar 30
4
a for loop to lapply
Dear all,
I am trying to learn lapply.
I would like, as a test case, to try the lapply alternative for the
Shadowlist<-array(data=NA,dim=c(dimx,dimy,dimmaps))
for (i in c(1:dimx)){
Shadowlist[,,i]<-i
}
---so I wrote the following---
returni <-function(i,ShadowMatrix) {ShadowMatrix<-i}
lapply(seq(1:dimx),Shadowlist[,,seq(1:dimx)],returni)
So far I do not get same results
2012 Feb 02
1
"shifted" bar chart / battleship curve
What I want to do is create a horizontal bar chart matrix for a set of data that have a common set of variables (e.g., % of As, % of Bs, etc.) listed on the Y-axis and groups (e.g., Classes) on the X-axis. The key here is that the bars for each individual class plot are "centered" rather than left or right-justified. In archaeology plots similar to this are called battleship curves or
2011 Apr 27
6
Assignments inside lapply
Dear all I would like to ask you if an assignment can be done inside a lapply statement.
For example
I would like to covert a double nested for loop
for (i in c(1:dimx)){
for (j in c(1:dimy)){
Powermap[i,j] <- Pr(c(i,j),c(PRX,PRY),f)
}
}
to something like that:
ij<-expand.grid(i=seq(1:dimx),j=(1:dimy))
unlist(lapply(1:nrow(ij),function(rowId) { return
2012 Apr 27
3
kiteChart to show real values with scalebar
Dear R-users
I hope someone could help me on this problem.
I want to create a multiple kiteChart showing the real values with a
scalebar on each indicating the scale .
Here are some sample data to show what I want to achieve.
Y <- read.table(textConnection("Sample1 Sample2
60 20
150 50
300
2011 Apr 14
4
Categorical bubble plot
Hi,
I do not have much R experience just the basics, so please excuse
any obvious questions.
I would like to create bubble plot that have Categorical data on the x and y
axis and then the diameter if the bubble the value related to x and y.
Attached to the email is a pic of what I would like to do.
I do hope someone can help me.
--
Regards/Groete/Mit freundlichen Gr??en/recuerdos/meilleures
2012 Jun 19
1
R and C pointers
Dear R devel,
Apologies for these (most probably trivial) questions, doing my first
attempt to call C from R (and actually learning C in the process).
I need to pass a matrix to C, and after reading R-exts.pdf (many
times), I was unable to find how to handle matrices at C-level...
except for, what probably is the answer, that matrices are in fact
vectors with dimensions.
This is a sample code I
2009 Apr 28
1
latticeExtra: useOuterStrips and axis.line$lwd
Hi,
I'm working on some lattice wireframe figures that have two conditioning
factors, and I want the strips labelled on the top and left of the
entire plot, rather than above each individual panel. useOuterStrips()
does this, but it draws internal axis lines, even after I explicitly set
axis.line to 0. Is there a way to use useOuterStrips but without axis
boxes?
I've included a short
2011 Apr 22
1
ggplot
Hello everyone,
I am using ggplot
to plot but I am getting the following error which I do not understand
Error: geom_text requires the following missing aesthetics: label
My code is
dimx<-256
library(ggplot2)
dev.new()
xandy<-expand.grid(seq(1:dimx),seq(1:dimy))
xx<-data.frame(xandy[[1]],xandy[[2]],Powermap=Powermap)
subsetxx<-subset(xx, xx$Powermap>threshold)
2007 Jun 19
3
Controlling text and strip arrangement in xyplot
I've searched the archives and read the xyplot help but can't figure
out the 2 lattice questions below?
Consider:
library(lattice)
DF <- data.frame(x=rnorm(20), y=rnorm(20), g1=rep(letters[1:2], 10),
g2=rep(LETTERS[1:2], each=10),
g3=rep(rep(letters[3:4],each=5),2))
xyplot(y ~ x | g1 + g2, groups=g3, data=DF)
1) Is there a way to get one strip per row and column
2012 Mar 12
1
2 images on one plot
Dear all
with image I can plot only one set of values in one plot.
Do somebody have any insight how to put those 2 matrices into one picture
so that in one cell in image picture are both values from mat[1,1] and
mat2[1,1].
mat<-matrix(1:4, 2,2)
mat2<-matrix(4:1,2,2)
x <-1:2
y <-1:2
image(x, y, mat)
image(x, y, mat2)
The only way I found is to mix x or y for both matrices let
2005 Sep 28
7
Plot Data Points in boxplots
Hello,
I would like to plot my data in a fashion similar to a boxplot, but
plot the true data points without a box, just overlay lines of the
summary generated by the boxplot. I have less than 10 observations
within each group, so I think showing the actual data would be more
effective than the box of the boxplot. I have been unable to find a way
to do this.
Here is example data:
>
2011 Oct 15
2
function for handling time
Dear all
I have the following time stamps (in the following format)
MeasurementSet$TimeStamps
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 2011 7 2 13 43 48.718
[2,] 2011 7 2 13 43 54.281
[3,] 2011 7 2 13 43 59.843
[4,] 2011 7 2 13 44 5.390
[5,] 2011 7 2 13 44 10.859
[6,] 2011 7 2 13 44 16.375
[7,] 2011 7 2 13 44
2003 Oct 29
3
long algo
Hi everyone,
I ve been using R for months and find it really
practical and straight forward.
However (the inevitable however), I am finding it very
slow for one of my operations:
it s basically an itertation over i and j in a pretty
big table (4* 4608). It takes 30 minutes!!!!
Thanks
Ps:if it can help here is the source:
median1<-matrix(nrow=4608,ncol=1)
2007 Jan 09
3
dimensions of a all objects
Why will the following command not work
sapply(objects(),dim)
What does it say about the objects list? What does it say about the dim
command?
Likewise, the following also does not work
all<-ls()
for (f in all) print(dim(f))
--
Farrel Buchinsky
[[alternative HTML version deleted]]
2018 Jan 19
1
Leaflet maps. Nudging co-incident markers
I have a dataset showing points, with a category for each point and its location.
I simply want to display my points, in a way that users can toggle the points on and off by category.
Where I have two objects in the same category I'd like to display them nudged to appear as two distinct, but very close points.
I have made reproduceable example (the places are not real), which is loosely
2011 Apr 09
1
For->lapply->parallel apply
Dear all,
I would like to ask your help understand the subsequent steps for making my program faster.
The following code:
Gauslist<-array(data=NA,dim=c(dimx,dimy,dimz))
for (i in c(1:dimz)){
print(sprintf('Creating the %d map',i));
Gauslist[,,i]<-f <- GaussRF(x=x, y=y, model=model, grid=TRUE,param=c(mean,variance,nugget,scale,Whit.alpha))
}
creates 100 GaussMaps (each
2007 Apr 24
4
Size of an object in workspace
Hi folks,
Is there a function to show the size of an R object? eg. in Kbytes?
Couple months ago Bendix Carstensen posted this marvelous little function lls(), which shows all objects in the current workspace by mode, class and 'size'. This is a wonderful enhancement to the build-in ls() already and I now have it sourced in my Rprofile.site at startup.
The only drawback is,
2007 Sep 04
3
how to do interpolation
Hello R Users,
How to make a variable equidistance with time i.e. how to interpolate a
variable if it is not sampled at equal time interval.
Many thanks,
Regards,
Yogesh
[[alternative HTML version deleted]]
2014 Nov 24
1
Error "promise already under evaluation ..." with function(x, dim=dim(x))
On Sat, Nov 15, 2014 at 1:47 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
>
> On 14/11/2014, 9:06 PM, Henrik Bengtsson wrote:
> > I've meant to ask the following for several years now. I understand why:
> >
> >> foo <- function(x, dim=dim) { dim }
> >> foo(1)
> > Error in foo(1) :
> > promise already under evaluation:
2006 Oct 31
0
6286816 page_numtopp_nolock is inefficent
Author: kchow
Repository: /hg/zfs-crypto/gate
Revision: 6c5e7d7096ce47499922b13d2536fb929f6c843f
Log message:
6286816 page_numtopp_nolock is inefficent
6288107 Missing comment terminator in i86pc/ml/locore.s
6290613 high page_get_cachelist failure rate on jurassic
6297005 performance issues with page_nextn()
Files:
update: usr/src/uts/common/os/mem_cage.c
update: usr/src/uts/common/sys/cpuvar.h