Displaying 14 results from an estimated 14 matches similar to: "Problem with function"
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,
2010 Dec 14
1
Modifying values outside a function using "apply".
I am sure this si a simple problem but the solution is evading me.
I have a list of matrices all with the same number of columns but different
number of rows. The first two columns label the row. The labels are
allways the same for the same row numbers, just some matricies have more
rows.
For example using 3 column matrices...
> q.1 <- function(r){return(cbind(seq(0, 10, by=1)[1:r],
2006 Jun 13
2
automated data processing
I have many files (0.4.dat, 0.5.dat, ...) of which I would like to calculate mean value and variance and save the output in a new file where each line shouldlook like: "0.4 mean(0.4.dat) var(0.4.dat)" and so on. Right now I got a a simple script that makes me unhappy:
1. I run it by "R --no-save < script.r > out.dat" unfortunately out.dat has all the original commands in
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
Hi,
We sometimes see offers to contribute, asking what needs to be done. If
they know C, how about the 111 FIXMEs? But which ones would be most
useful to fix? Which are difficult and which are easy? Does R-core have
a process to list and prioritise the FIXMEs?
~/R/Rtrunk/src/main$ grep "[^/]FIXME" * | wc -l
111
~/R/Rtrunk/src/main$ grep -A 1 "[^/]FIXME" *
arithmetic.c:/*
2008 Nov 24
1
Check for date variable in a arbitrary dataset
Hello,
This is my first time posting to the R-help list and I apologize for
the apparent triviality of my query.
I am creating an R script to create Univariate Exploratory Analysis of
a input dataset (No meta-data to provide extra information about each
column)
.
Providing summary statistics is possible in case of numeric data and
using all.is.numeric() from the Hmisc package allows me to filter
2006 Jan 13
2
Mass Mailing
Has anyone found a good method of mass mailing a bunch of people (100k)
using RoR yet?
I have always used a scheduled task to run a ColdFusion page every x
minutes to send out blocks of about 7500 (sending the full 100k crashed
the page) and this worked pretty well and now we are migrating all out
sites to ruby, I seed to do something similar.
Thanks in advance,
James
2018 Aug 18
1
image() method for Matrix fails on empty matrices (?)
Reasonably easy to avoid, but maybe an edge case that should be
handled? Haven't looked yet to see how easy it would be to fix ... Am I
missing something?
> library(Matrix)
> m <- Matrix(0,nrow=3,ncol=3)
> m
3 x 3 sparse Matrix of class "dsCMatrix"
[1,] . . .
[2,] . . .
[3,] . . .
> image(m)
Error in seq.default(zrng[1], zrng[2], length.out = cuts + 2) :
2006 May 17
1
for loops and counter interpolation
Hi
I'm sorry about the triviality of my problem. I have a vector (v) of three
columns (logA, logB, id). I want to compute (and plot) the correlation between
logA and logB for different thresholds of id (e.g. >30, etc). So I tried:
for(i in 1:100){
points(cor(v$logA[v$id>i], v$logB[v$id>i], use="complete.obs"), i))
}
(i created a plot object already)
but it comes with
2004 Aug 16
2
1.0 RC2 External AGI Issues
Hi All,
I'm trying to execute an external AGI script but get just the following:
-- Executing AGI("SIP/xlite-2fa7", "agi-test") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/agi-test
-- AGI Script agi-test completed, returning 0
For whatever reason, it looks like the AGI script is just exiting without
feeding the correct commands into
2004 Aug 01
3
Creating dummy codes
Is there an efficient way to create a series of dummy codes from a single variable? For example, I have a variable, “grade” = {2, …, 12}. I want to create k-1 dummy codes for grade such that grade 2 is the base (i.e, grade 2 =0).
I am hoping that the new variables can be labeled as grade.3, grade.4 etc. I'll then use
grade <- paste("grade.", 3:12, sep="") in
2009 Feb 02
6
Problems in Recommending R
Dear List,
One persistent feedback I am getting to people who are newly introduced to R
( especially in this cost cutting recession) is -
1) The website looks a bit old.
While the current website does have a lot of hard work behind it, should n't
a world class statistics package have a better website instead.
You can check out www.knime.org which is an open source software , and free,
and
2019 Sep 16
16
[PATCH 0/8] v2v: various fixed for -o rhv-upload
This patch series fixes various issues in the rhv-upload output mode:
- properly find and use RHV resources
- cleanup orphan disks, and possibly the current disk transfer on
failure
In reality, the first 4 patches deal with resources, and the other 4
with cleanups. The latter block can be theoretically sent alone --
I just happened to start working on it as part of my "let's fix