similar to: sapply/lapply instead of loop

Displaying 20 results from an estimated 100 matches similar to: "sapply/lapply instead of loop"

2006 Aug 09
2
Speeding indexing and sub-sectioning of 3d array
Hi, I am having a problem with a very slow indexing and sub-sectioning of a 3d array: > dim(arr) [1] 245 175 150 For each point in the array, I am trying to calculate the mean of the values in its surrounding: mean( arr[ (i - radius):(i + radius), (j - radius):(j + radius), (k - radius):(k + radius)] ) Putting that code in 3
2009 Sep 25
1
simulating a model
Dear useRs, I have written an ecological model, based on the epidemiology SIR model. I've been trying to simulate it in R. However, I can't simulate it properly. Two guesses: my script isn't right; I'm not setting the parameters properly I have uploaded an image to the model here: http://img24.imageshack.us/img24/743/imagemutr.jpg The script I am using is as it follows:
2015 Aug 22
3
sprintf error: "only 100 arguments allowed"
I'm trying to apply a function defined in the VW R docs, that attemps to convert a data.table object to Vowpal Wabbit format. In the process i'm getting the error in printf mentioned in the subject. The original function is here: https://github.com/JohnLangford/vowpal_wabbit/blob/master/R/dt2vw.R Below there is a small example that reproduces the error. The function works great with
2009 Jan 23
2
Plot, lines and disordered x and y
Hello, I have 2d data where x coordinate is not given in usual ascending order (x1,...,x1+l; l>0), and instead in another, regular, but not ascending or descending order (for illustration: x1,-x1,x1+dx1,-x1-dx1,....).y is an array which corresponds to the way x is ordered. I have noticed that giving 'plot(x,y,type='l') produces a plot where the points are connected in a completely
2001 Apr 19
2
Multiple linear regression
Dear R-users, I've a question regardiing multiple linear regression. Is it possible to regress a function of the type y=b0+b1*x1+b2*x2 constraining the partial derivatives dy/dx1 and dy/dx2 to be greater than 0 ??? Thank you very much for any possible suggestion. Best regards Marco -- Marco Pagani - PhD Student Dipartimento di Scienze della Terra - Sezione Geofisica Universita' degli
2003 Oct 23
2
OOP like handling of lists?
Hello, I am writing a package with a collection of several models. In order to allow users to play interactively with the models (in contrast to hacking lengthy scripts), I want to put all what is needed to run a particular model into a single list object for each model. Then there will be a collection of functions to run the model or to modify parameters, time steps, integration method ...,
2015 Aug 26
1
sprintf error: "only 100 arguments allowed"
Wouldn't it make sense to have this in the man page? The 8192-byte limitation for 'fmt' is mentioned but not this one. Thanks, H. On 08/25/2015 02:08 AM, Prof Brian Ripley wrote: > From the sources: > > #define MAXNARGS 100 > /* ^^^ not entirely arbitrary, but strongly linked to > allowing %$1 to %$99 !*/ > > > > On 22/08/2015 04:21, Martin
2008 Jul 14
2
long data frame selection error
Hello, I am trying to select the following headers from a data frame but when I try and run the command it executes halfway through and give me an error at V188 and V359. Temp <- data.frame(V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30, V31, V32, V33, V34, V35, V36, V37, V38, V39, V40, V41, V42, V43, V44, V45,
2006 Feb 01
2
sort columns
Hi. I have a simple (I think) question My dataset have these variables: names(data) [1] "v1" "v2" "v3" "v4" "v5" "v6" "v7" "v8" "v9" "v10" "v11" "v12" "v13" "v14" "v15" "v16" "v17"
2006 Apr 29
1
SSPIR problem
I am having a problem with the package SSPIR. The code below illustrates it. I keep getting the message: "Error in y - f : non-conformable arrays." I tried to tweak the code below in many different ways, for example, substituting rbind for cbind, and sometimes I get a different error message, but I could not find a variation of this code that would work. Any help will be greatly
2011 Oct 27
1
preceding X. and X
Hello, Why do I get preceding "X." (that is a and X followed by a period) for negative numbers and an "X" for positive numbers when I read a csv file? Am I stuck with this? If so, how do I convert it to normal numbers? dat=read.csv(file_path) > dat [1] X0.0 X.0.240432350374 X0.355468069625 X.0.211469972378 X1.1812797415 X.0.227975150826
2004 Sep 15
3
Read.fwf
Dear List I have a fixed width file with variables of varying width. The help is pretty transparent for this feature, but I can't seem to figure out how I can make effective use of the package with my data. In my dataset, the first 80 columns are of width 1 followed by other variables with width larger than 1. I think the correct way to do this, by brute force, would be >
2009 Apr 05
3
WineVDM crash on CDROM speed test...
I'm trying to install Lords of The Realm II and while it doesn't affect whether or not you ca install the game, I have encountered two crashes if you allow the installer to test your system. The crashes occur when testing CDROM speed and when checking processor speed. CDROM speed test error: Code: 68 0x7eb1ee57 DispatchMessageW+0x103() in user32 (0x007fdff8) 69
2012 Feb 01
0
Multi-response, multi-rater kappa?
I'm looking for an extension of kappa to measure agreement among multiple raters when there can be more than one response per subject. For example, say a group of doctors assign diseases to patients. Each patient will be assigned one to many diseases, and the number of doctors assigning diseases to any one patient will be two to many. Here's an extremely simple example of the type of
2005 Oct 20
0
[PATCH][VT] disable bogus touchpad device model, which cause annoying dmesg on 2.6 kernel
disable bogus touchpad device model, which cause annoying dmesg on 2.6 kernel Signed-off-by: Edwin Zhai <edwin.zhai@intel.com> diff -r 7c951e3eb5ab -r 14d3890843d0 tools/ioemu/hw/pckbd.c --- a/tools/ioemu/hw/pckbd.c Wed Oct 19 11:53:00 2005 +0100 +++ b/tools/ioemu/hw/pckbd.c Thu Oct 20 18:28:18 2005 +0800 @@ -29,6 +29,9 @@ /* debug PC keyboard : only mouse */ //#define DEBUG_MOUSE +/*
2004 Nov 18
1
gibbs sampling for mixture of normals
hi i'm looking for a gibbs sampling algorithm for R for the case of mixture of K normals, and in particular for the case of bivariate normals. i'd be grateful if anyone could send its own R-routine, at least for the univariate case. thank you in advance matteo
2015 Aug 25
0
sprintf error: "only 100 arguments allowed"
From the sources: #define MAXNARGS 100 /* ^^^ not entirely arbitrary, but strongly linked to allowing %$1 to %$99 !*/ On 22/08/2015 04:21, Martin Bel wrote: > I'm trying to apply a function defined in the VW R docs, that attemps to > convert a data.table object to Vowpal Wabbit format. In the process i'm > getting the error in printf mentioned in the subject.
2006 Oct 17
1
Error: STRING_ELT() can only be applied to a 'character vector', not a 'builtin'
I have a daily job that attaches hundreds of pseudo-packages containing data as promise objects (DDP's, ref: g.data package), and plots the results to a multi-page pdf device. Sometimes it fails. Under R-2.2.1 it just gave segfaults. Under R-2.3.1 it gave this error message: *** caught segfault *** address (nil), cause 'memory not mapped' Traceback: 1:
2004 Sep 15
6
Bessel function
Dear all Currently, I'm implementing the generalized hyperbolic distribution into Splus. Unfortunately the Bessel function is not implemented in Splus. In R the Bessel function does exist but it is an internal function and I'm not able to look at the code. Is there any possibility to see the code of the Bessel function in R or does anybody has an implementation of the Bessel function in
2008 Jul 04
1
Powerware UPS slots ports and protocols information
Here are some Powerware compatibility info I got by a colleague, and authorized to publish. @Kjell: can you take over checking our driver.list and other info source to see if there's a gap? thanks, Arnaud ________________________________________________________________________ Old info from ca. 2002, but still mostly valid except that some 5125s got a