Re: [R] perfectionism

2011-11-25 Thread Barth B. Riley
Z[f] would return the fth values in z. That is, if f = c(1,2) z[f] would return the first and second elements of z. The original intent was to obtain the indices in z corresponding to the values in f. Barth -Original Message- From: r-help-boun...@r-project.org

[R] Editor color

2011-06-24 Thread Barth B. Riley
Dear list Despite having set color settings for the console and script editing window, when I open R and open a script file the text is black against a black background (should be, according to the rconsole colors I saved, yellow against black). I have tried repeatedly to reload and reapply

[R] Turning a vector into a matrix based on a matrix of vector indices

2011-04-27 Thread Barth B. Riley
Hello I have a matrix (though it could also be a ragged array) called items.used, that has the item numbers of questions administered to a set of respondents. I also have a vector of item parameters called b[]. I am looking for an elegant way to create a matrix b.mat in which each element is

Re: [R] for loop performance

2011-04-14 Thread Barth B. Riley
Thank you Phillip for your post. I am reading in: 1. a 3 x 100 item parameter file (floating point and integer data) 2. a 100 x 1000 item response file (integer data) 3. a 6 x 1000 person parameter file (contains simulation condition information, person measures) 4. I am then computing several

Re: [R] for loop performance

2011-04-14 Thread Barth B. Riley
Thanks Martin, this is very helpful. Barth -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: Thursday, April 14, 2011 11:04 AM To: Barth B. Riley Subject: Re: [R] for loop performance On 04/14/2011 07:12 AM, Barth B. Riley wrote: Hi Martin Question--when

[R] for loop performance

2011-04-13 Thread Barth B. Riley
Dear list I am running some simulations in R involving reading in several hundred datasets, performing some statistics and outputting those statistics to file. I have noticed that it seems that the time it takes to process of a dataset (or, say, a set of 100 datasets) seems to take longer as

[R] Collapsing/aggregating columns in a matrix

2011-03-24 Thread Barth B. Riley
Dear list I want to know if there is a function in R that enables one to create a new matrix based on values in an existing matrix, whereby each column in the new matrix is a row-specific summary (e.g., sum, mean) of multiple columns in the original matrix. For instance, to take a 12-column

[R] Creating a ragged array

2011-02-11 Thread Barth B. Riley
Dear list I am trying to figure out how to create a ragged array that consists of groups of array elements (indices from the original array) of similar values. I would like to create a ragged array that might look something like this: S[1] 11, 19, 14,7 S[2] 29,4,1,13,44 S[3] 56,9,2,35 S[4]

[R] Obtaining a quadratic function igven three points on a curve

2011-01-20 Thread Barth B. Riley
Hello I would like to obtain the coefficients for a quadratic function (ax^2 + bx + c) given three sets of points on the quadratic curve. For instance: Y X 0.1595290 0.5 0.773019 1 1 Is there a function in R to

Re: [R] Obtaining a quadratic function given three points on a curve

2011-01-20 Thread Barth B. Riley
Thanks Josh and David Barth PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for the use of the addressee. If you are not the designated recipient, or an

[R] Getting the minimum/maximum value of each row of a matrix

2011-01-14 Thread Barth B. Riley
Hello Is there a straightforward way of getting a vector containing the minimum (or maximum) value of each row of a matrix? Thanks Barth PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any attachments may contain PRIVILEGED AND CONFIDENTIAL information and is intended only for

[R] Problem retrieving data from R2InBUGS

2010-11-12 Thread Barth B. Riley
Dear list I am calling the functiton bugs() provided by R2WinBugs to performs an IRT analysis. The function returns a set of estimated parameters over n replications/iterations. For each replication, two sets of person measures (theta1 and theta2) and two sets of item difficulty parameters

[R] Getting the size of text

2010-10-20 Thread Barth B. Riley
Dear list I am interested n developing a graph using plot() and text() commands in which several text strings will be placed within the plot area I would like some way to get the size (width and height), either in pixels or using the plot's coordinate system, of text strings, based on the

[R] Trouble accessing cov function from stats library

2010-10-11 Thread Barth B. Riley
Dear all I am trying to use the cov function in the stats library. I have no problem using this function from the console. However, in my R script I received a function not found message. Then I called stats::cov(...) and received an error message that the function was not exported. Then I