search for: dromano

Displaying 9 results from an estimated 9 matches for "dromano".

Did you mean: romano
2013 Feb 10
4
different behavior of $ with string literal vs string variable as argument
Hi everyone, I ran into the issue below while trying to execute a command of the form apply(list.names,1, function(x) F(favorite.list$x) ) where list.names is a character vector containing the names of the elements of favorite.list and F is some function defined on a list element. Namely, the $ operator doesn't treat the string variable 'x' as the string it represents, so that,
2013 Feb 06
3
how to "multiply" list of matrices by list of vectors
Hi everyone, I'd like to be able to apply lda to each 2D matrix slice of a 3D array, and then use the scalings to obtain the corresponding lda scores. I can use 'apply' to get a list of the lda output for each 2D slice, and can create a list of the resulting scalings, but I'm not sure how to multiply them in a vectorized way. Here's how I made a list of 2D matrices
2012 Dec 04
3
odd behavior of browser()
Hi everyone, I normally include a call to browser() as I'm working out the kinks in my scripts, and I am always able to step through each line by hitting "Return", but for some reason, in the scripts I'm working on now, hitting "Return" seems to cause execution of *all* the lines in my script. I've restarted R several times in case it was stuck in a bad state for
2013 May 03
2
how to parallelize 'apply' across multiple cores on a Mac
Hi everyone, I'm trying to use apply (with a call to zoo's rollapply within) on the columns of a 1.5Kx165K matrix, and I'd like to make use of the other cores on my machine to speed it up. (And hopefully also leave more memory free: I find that after I create a big object like this, I have to save my workspace and then close and reopen R to be able to recover memory tied up by R, but
2013 Feb 06
1
how to extract test for collinearity and constantcy used in lda
Hi everyone, I'm trying to vectorize an application of lda to each 2D slice of a 3D array, but am running into trouble: It seems there are quite a few 2D slices that trigger either the "variables are collinear" warning, or worse, trigger a "variable appears to be constant within groups" error and fails (i.e., ceases computation rather than skips bad slice). There are
2013 May 04
1
how to best add columns to a matrix with many columns
Hi everyone, I have large data frame, say df1, with 165K columns, and all but the first four columns of df1 are numeric. I transformed the numeric data and obtained a matrix, call it data.m, with 165K - 4 columns, and then tried to create a second data frame by replacing the numeric columns of df1 by data.m. I did this in two ways, and both ways instantly used up all the available memory, so
2012 Nov 15
4
using ifelse to remove NA's from specific columns of a data frame containing strings and numbers
Hi everyone, I have a data frame one of whose columns is a character vector and the rest are numeric, and in debugging a script, I noticed that an ifelse call seems to be coercing the character column to a numeric column, and producing unintended values as a result. Roughly, here's what I tried to do: df: a data frame with, say, the first column as a character column and the second and
2012 Dec 12
2
using 'apply' to apply princomp to an array of datasets
Hi everyone, Suppose I have a 3D array of datasets, where say dimension 1 corresponds to cases, dimension 2 to datasets, and dimension 3 to observations within a dataset. As an example, suppose I do the following: > x <- sample(1:20, 48, replace=TRUE) > datasets <- array(x, dim=c(4,3,2)) Here, for each j=1,2,3, I'd like to think of datasets[,j,] as a single data matrix with
2013 Feb 08
1
question about reproducibility/consistency of principal component and lda directions in R
Hi everyone, I'm not exactly sure how to ask this question most clearly, but I hope that giving the context in which it occurs for me will help: I'm trying to compare the brain images of two patient populations; each image is composed of voxels (the 3D analogue of pixels), and I have two images per patient, one reflecting grey matter concentration at each voxel, and the other reflecting