Displaying 20 results from an estimated 5000 matches similar to: "How to make this for() loop memory efficient?"
2010 Jul 16
0
Mixed Conditional Logit with nested data
Hello Everyone,
This is my first attempt to do something in R. As a precursor to a Willingness to Pay analysis, I want to conduct a Mixed Conditional Logit analysis but am unsure how to proceed because of some nesting within my data.
Below is some data and code that illustrate what I’m trying to do. The data are based on responses to a conjoint survey obtained during pilot testing. In the
2007 Mar 02
2
PRI progress codes.
Anyone know how to let asterisk deal with the progress codes coming
from the carrier? The problem I am having is when a customer calls an
invalid number the carrier tells me the call is invalid via a progress
code but doesn't route me to a recording (this number is invalid).
Instead they hang up on me causing a fast busy or sometimes hold up
the call with dead air for 15 to 30 seconds then a
2008 Nov 25
1
Efficient passing through big data.frame and modifying select
> -----Original Message-----
> From: William Dunlap
> Sent: Tuesday, November 25, 2008 9:16 AM
> To: 'johannes_graumann at web.de'
> Subject: Re: [R] Efficient passing through big data.frame and
> modifying select fields
>
> > Johannes Graumann johannes_graumann at web.de
> > Tue Nov 25 15:16:01 CET 2008
> >
> > Hi all,
> >
> >
2010 Nov 17
3
Parameterising apply To Compute Rolling Average of Columns in a matrix
I sent a post to find a clever way to compute a Rolling Average of columns
in a matrix and I was given the solution below which I am very pleased
with.
RollingAverage <- function(x, RollingObs) {
cx <- cumsum(x);
N <- length(x);
Temp <- (cx[RollingObs:N] - c(0, cx[1:(N-RollingObs)]))/RollingObs
Output <- array(NA, N)
Output[RollingObs:N] <- Temp;
Output
}
The only
2007 Aug 28
2
Efficient way to parse string and construct data.frame
Hi all,
I have this list of strings
[1] "1 ,2 ,3" "4 ,5 ,6"
Is there an efficient way to convert it to data.frame:
V1 V2 V3
1 1 2 3
2 4 5 6
Like I can use strsplit to get to a list of split strings.. and then use say
a = strsplit(mylist, ",")
data.frame(V1 = lapply(a, function(x){x[1]}), V2 = lapply(a,
function(x){x[2]}),.....)
but i'm
2008 Nov 25
0
Efficient passing through big data.frame and modifying select fields
Hi all,
I have relatively big data frames (> 10000 rows by 80 columns) that need to be exposed to "merge". Works marvelously well in general, but some fields of the data frames actually contain multiple ";"-separated values encoded as a character string without defined order, which makes the fields not match each other.
Example:
> frame1[1,1]
[1] "some;thing"
2009 Oct 26
2
exclude data for boxplot stats using mathematical operator
Readers,
I have a data set as follows:
1,1
2,2
3,3
4,4
5,3
6,2
7,-10
8,-9
9,-3
10,2
11,3
12,4
13,5
14,4
15,3
16,2
17,1
I entered this data set using the command 'read.csv'. I want to
exclude values fewer than zero in column 2 so then I tried the
following command:
boxplot.stats(x[>0,2],do.conf=FALSE)
Error: syntax error, unexpected GT, expecting ',' in
2011 Feb 07
3
Giving vector of colors to line in plots
Hey all,
I can't for the life of me figure out what I'm missing here. I'm trying
to change the color of the line in a time series type plot. I can
change the point colors and symbols no problem, but for some reason the
colors do not get passed to the lines, regardless of if I do type="b" or
type="l". The sample code I'm using is below.
Any help would be
2009 Jun 27
1
Multiple parking lots use default park positions
Hello, all. I'm having a deeply frustrating time getting multiple
parking lots to work and am wondering what I am doing wrong. I am using
Asterisk 1.6.1.1. I defined two separate parking lots in features.conf
as follows:
[parkinglot_a100] ; SSI
context => a100-parking
parkpos => 900-920
findslot => next
[parkinglot_a10] ; EBC
context => a10-parking
parkpos => 800-820
2008 Jan 02
2
Seeking a more efficient way to read in a file
Hi.
I have a matrix stored in a large, tab-delimited flat file. The first row contains column names. Because the matrix is symmetric, the file has lower triangular format, so the second row contains one number, the third row two numbers, etc. In general, row k+1 contains k numbers; the matrix has 3000 rows, so the file has 3001 rows. The file has variable length records, so each row ends
2010 Nov 16
2
Computing Rolling Average
Hi,
Can anyone suggest a clever way to compute a rolling weekly average of the
columns in a matrix? The column bit is straightforward – use apply given a
function which does what you want on a column. With regard to a particular
column, the obvious way is to run a for loop indexing the last 7 days and
computing the average . I simply would like to know if there is a better /
quicker way.
2011 Mar 31
0
dfsane arguments
Hi there,
I'm trying to solve 2 nonlinear equations in 2 unknowns using the BB
package.
The first part of my program solves 3 ODEs using the deSolve package. This
part works. The output is used as parameter values in the functions I need
to solve.
The second part is to solve 2 equations in 2 unknowns. This does not work. I
get the error message "unexpected end of input". So what
2010 Oct 19
0
R script help needed for RFC 2104 HMAC algorithm
I'm trying to create an R script that will execute the HMAC algorithm for
key-hashing messages. My hope is to use this script for some web
authentication via R.
The algorithm is found at http://www.ietf.org/rfc/rfc2104.txt
Here is some example code that I have done that does not work for HMAC-MD5.
I'm a big confused by the algorithm since I don't have a very good working
knowledge
2012 Nov 08
5
map two names into one
Thanks.
Yes. Your approach can identify:
Glaxy ace S 5830 and
S 5830 Glaxy ace
But you can not identify using same program:
Iphone 4S 16 G
Iphone 4S 16G
How should I solve both in same time.
Kind regards,Tammy
[[alternative HTML version deleted]]
2006 Jan 06
1
Problem with integrating ISDN PBX using NT mode
Hi,
I'm just in the process of replacing a crappy Siemens PBX with a new and
shiny Asterisk system. To connect Legacy equipment I hooked up a small
ISDN PBX (DeTeWe OpenCom 36) to one port on a Junghanns.net quadBRI
card. That port is configured for NT Point to Multipoint
(Mehrgeraeteanschluss) mode. Now I can place calls from the ISDN PBX to
the other Asterisk extensions but the other way
2009 Apr 30
1
stepAICc
Dear R users,
Would it be difficult to change the code of stepAIC (from the MASS
library) to use AICc instead of AIC?
It would be great to know of someone has tried this already.
Best wishes
Christoph.
2014 Jan 31
2
manipulación de caracteres
lo que necesito es
"98989","121212"
y no :
paste(unlist(strsplit(char,",")),collapse=",")
[1] "98989,121212"
Luis
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Luis Ridao Cruz
Faroe Marine Research Institute
Nóatún 1, P.O. Box 3051
FO-110 Tórshavn
Faroe Islands
Tel : (+298) 353900
Fax: : (+298) 353901
e-mail: luisr@hav.fo
2003 Dec 14
5
reverse lexicographic order
Hi all,
I have some email addresses that I would like to sort in reverse
lexicographic order so that addresses from the same domain will be
grouped together. How might that be done?
Murray
--
Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz
2006 Jul 17
10
String manipulation and formatting
I'm trying to write a simple function that does the following:
[command] xify(5.2)
[output] XXX.XX
[command] xify(3)
[output] XXX
Any simple solutions (without using python/perl/unix script/...)?
Thanks,
Saghir
---------------------------------------------------------
Legal Notice: This electronic mail and its attachments are i...{{dropped}}
2023 Feb 15
0
Question about italics in legendg() - plotrix
Hi Nicole,
plotrix is intended to be modular, that is, it builds plots step by step.
This makes it easier to understand code that you haven't written or haven't
seen for a while. Here is an example showing how to change the font using
par():
library(plotrix)
plot(0,type="n",xlim=c(0,1),ylim=c(-1,0))
par(font=3)
legendg(0.115,-0.055,legend=c("Pan