Displaying 6 results from an estimated 6 matches for "thiscol".
Did you mean:
this'll
2012 May 21
2
Problem with function
...for the triviality of this question,
but I was wondering if anyone could tell me why this function doesn't return
the expected output, i.e. a matrix containing two columns from a large data
frame called 'finalTable'? Oddly, the statement between the curly brackets
works if run with 'thisCol' and 'thatCol' already defined. Any help would be
much appreciated.
Here's what 'finalTable' looks like, if it helps:-
Many thanks, Adam
--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-function-tp4630805.html
Sent from the R help mailing li...
2010 Dec 14
1
Modifying values outside a function using "apply".
...2 14 0.9664470
[[2]]
[,1] [,2] [,3]
[1,] 0 10 0.09678172
[2,] 1 12 0.75177116
[3,] 2 14 0.59927159
[4,] 3 16 0.18472215
[[3]]
[,1] [,2] [,3]
[1,] 0 10 0.6343689
[2,] 1 12 0.8121039
Given such a list I would like to create a matrix:
0 10 mean(ThisCol for this row)
1 12 mean(ThisCol for this row)
2 14 mean(ThisCol for this row)
3 16 mean(ThisCol for this row)
I can loop using a for loop but I would like to use apply but I have no idea
how to get it to work. If I could pass arguments by reference to a function
it would be easy but as far as I c...
2008 Dec 04
2
How to optimize this codes ?
How to optimize the for-loop to be reasonably fast for sample.size=100000000 ? You may want to change sample.size=1000 to have an idea what I am achieving.
set.seed(143)
A <- matrix(sample(0:1, sample.size, TRUE), ncol=10, dimnames=list(NULL, LETTERS[1:10]))
B <- list()
for(i in 1:10) {
B[[i]] <- apply(combn(LETTERS[1:10], i), 2, function(x) { sum(apply(data.frame(A[,x]), 1,
2004 Aug 03
3
basic questions: any place for them
Hi
I have two basic questions, and here they go, but I was wondering as
well where can I ask these basic questions without bothering you
people
I've used Splus and now I'm using R and there's some functions that I
can't simply find
one:
sort.col
that allows data.frames to be sort by a given col
(I saw the funtion sort but that's for vectors. and I can't believe I
2009 Sep 03
1
Output from as.windrose() in oce package baffles me
I'm having trouble understanding the output from as.windrose(). For one
thing, data on a boundary between sectors seem to be left out of the
counts. I assume that explains the missing point in the output below
(angle 45). Shouldn't one side of each sector interval be open, to
include values such as my 45 in the example? Also, why does the angle
180 in my input apparently not result in
2012 Mar 13
0
111 FIXMEs in main/src
...nsistency] Use macro for the parallel parts
of
plot3d.c- do_contour, do_filledcontour & do_image ...
--
plot.c: FIXME: bg needs similar change, but that requires changes
to
plot.c- the specific drivers. */
--
plot.c: /* FIXME: should this skip 0-sized symbols? */
plot.c- thiscol = INTEGER(col)[i % ncol];
--
plot.c: /* FIXME?
plot.c- * Seems like the logic here is just draw from xmin to xmax
--
plot.c: /* FIXME: should this skip 0-sized symbols? */
plot.c- GRect(xx - rx, yy - rx, xx + rx, yy + rx, DEVICE,
--
plot.c: /* FIXME: should this skip 0-sized symbols? */
plot.c-...