similar to: List comprehensions for R

Displaying 20 results from an estimated 600 matches similar to: "List comprehensions for R"

2010 Feb 10
2
system.time provides inaccurate sys.child (PR#14210)
Full_Name: Manuel L?pez-Ib??ez Version: R version 2.6.2 (2008-02-08) OS: linux-gnu Submission from: (NULL) (164.15.10.156) This is only relevant for CPU intensive child processes. Otherwise, the problem is not obvious. Therefore, we need a CPU intensive program like this one: /************************************/ /*** Compile with: gcc -o timer-test -O0 timer-test.c -lm */ #include
2011 Aug 17
1
multinomRob - error message
Hi, I would like to use the multinomRob function to test election results. However, depending on which independent variables I include and how many categories I have in the dependent variable, the model cannot be estimated. My data look like this (there are 68 observations): > head(database) RESTE09 GAUCHE09 PDC09 PLR09 UDC09 MCG09 RESTE05 GAUCHE05 PDC05 D1 1455
2012 Dec 10
3
equivalent of group command of the egen function in Stata
Dear R listers, I am trying to create a new variable that uniquely identifies groups of observations in a dataset. So far I couldn't figure out how to do this in R. In Stata I would simply type: egen newvar = group(dim1, dim2, dim3) Please, find below a quick example to show what I am dealing with: I have a dataset with 4 variables: var <- runif(50) ## a variable that I want to group
2012 Apr 26
2
Memoize and vectorize a custom function
My goal is simple: calcuate GC content of each sequence in a list of nucleotide sequences. I have figured out how to vectorize, but all my attempts at memoization failed. Can you show me how to properly memoize my function? There is a StackOverflow post on the subject of memoization, but it does not help me: http://stackoverflow.com/questions/7262485/options-for-caching-memoization-hashing-in-r
2010 Nov 08
1
unknown dimensions for loglm
Dear R-help community, I am working with multidimensional contingency tables and I am having trouble getting loglm to run on all dimensions without typing out each dimension. I have generated random data and provided output for the results I want below: d1.c1 <- rnorm(20, .10, .02) d1.c2 <- rnorm(20, .10, .02) d2.c1 <- rnorm(20, .09, .02) d2.c2 <- rnorm(20, .09, .02) d3.c1 <-
2012 Dec 07
1
points3d and ordirgl
Hello all, I have been using the function ordirgl to plot 3D dynamic ordinations. The ordirgl function works just fine. IN fact, I was even able to write a function that allows me to identify points in the 3D plot: identify.rgl<-function(env_var,ord,dim1,dim2,dim3) { tmp<-select3d(button="left") tmp.keep<-tmp(ord[,dim1],ord[,dim2],ord[,dim3])
2014 Nov 12
2
Connection failing between 2 nodes with dropped packets error
Hi, I'm sometimes getting a failure of connecting 2 nodes when Tinc is started and configured in a LAN. In the logs, there are some unexpected dropped packets with very high or negative seq. I can reproduce this issue ~2% of the time. When this happens, the 2 nodes can no longer ping or ssh each other through the tunnel interface but using eth0 works fine. The connection can recover after at
2007 Jan 17
4
Memory leak with character arrays?
Hi - When I'm trying to read in a text file into a labeled character array, the memory stamp/footprint of R will exceed 4 gigs or more. I've seen this behavior on Mac OS X, Linux for AMD_64 and X86_64., and the R versions are 2.4, 2.4 and 2.2, respectively. So, it would seem that this is platform and R version independant. The file that I'm reading contains the upstream regions
2001 Dec 31
2
Extracting/setting elements from/in a matrix/array
Dear all, I had to extracts/set elements from/in a matrix. Let say I have two vectors dim1 and dim2 of indices in the respective two dimensions of a matrix: I want to extract all the corresponding elements. I the case of a nxn matrix, dim1 <- 1:n and dim2 <- 1:n would extract the diagonal. I know one way would be to use the functions 'row' and 'col', but the matrixes I
2006 Dec 17
2
question
Dear R users, I'am using marray and Limma packages to analyze genepix output. 1) how can I filter bad spots from my data (data contains 3 types of bad spots). my experiment contains 12 samples and the bad spot are not associated to the same probes 2) how can I remove control probes from my data ? I'm sorry, i'm new with R and I can't find answer in packages doc. best regards,
2012 Apr 05
0
Multi part problem...array manipulation and sampling
Ok, I have a new, multipart problem that I need help figuring out. Part 1. I have a three dimensional array (species, sites, repeat counts within sites). Sampling effort per site varies so the array should be ragged. Maximum number of visits at any site = 22 Number of species = 161 Number of sites = 56 I generated the array first by;
2010 Jan 20
1
Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements
Hi, See my example below. a<-array(1:12,c(2,3,2)) > a , , 1 [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 , , 2 [,1] [,2] [,3] [1,] 7 9 11 [2,] 8 10 12 I want to get a result something like dim1 dim2 dim3 elements 1 1 1 1 2 1 1 3 2 2 1 2 I tried the data.frame and expand.grid functions,
2011 May 10
3
metaMDS and envfit: Help reading output
Hello R experts, I've used metaMDS to run NMDS on some fish abundance data, and am also working on correlating environmental data to the NMDS coordinates. I'm fairly new to metaMDS and NMDS in general, so I have what are probably some very basic questions. My fish abundance data consists of 66 sites for which up to 20 species of fish were identified and counted. I ran metaMDS on this data
2010 Dec 21
3
Performing basic Multiple Sequence Alignment in R?
Hello everyone, I am not sure if this should go on the general R mailing list (for example, if there is a text mining solution that might work here) or the bioconductor mailing list (since I wasn't able to find a solution to my question on searching their lists) - so this time I tried both, and in the future I'll know better (in case it should go to only one of the two). The task
2013 Nov 08
1
Different output from lm() and lmPerm lmp() if categorical variables are included in the analysis
I've found a problem when using categorical variables in lmp() from package lmPerm According to help(lmp): "This function will behave identically to lm() if the following parameters are set: perm="", seq=TRUE, center=FALSE.") But not in the case of including categorical variables: require(lmPerm) set.seed(42) testx1 <- rnorm(100,10,5) testx2 <-
2007 Aug 08
0
Creating netcdf from table
Hi! I have a table with 3 columns, 2 for long/lat coordinates and 1 for values (radon concentration). I have Tables for every week of the year 2006, always same coordinates but other values, i.e. time series. Now I want to create a NetCDF file for, which is much easier to handle than 52 tables. I tried the following for the first dataset (i.e first week):
2011 Feb 05
1
different results in MASS's mca and SAS's corresp
Dear list: I have tried MASS's mca function and SAS's PROC corresp on the farms data (included in MASS, also used as mca's example), the results are different: R: mca(farms)$rs: 1 2 1 0.059296637 0.0455871427 2 0.043077902 -0.0354728795 3 0.059834286 0.0730485572 4 0.059834286 0.0730485572 5 0.012900181 -0.0503121890 6
1999 Nov 30
2
seqN
I have been using a function seqN <- function(N) {if (0==length(N)) NULL else if (N<=0) NULL else seq(N)} in for loops when I want no looping in the case of a zero value: for (i in seqN(m) ) ... Since seqN(0) returns NULL this results in for doing no loops (which is much more convenient than always checking for m==0). It seems that a function like this should be defined in R (and S) but
2009 Nov 06
1
What is the best way to delete strings in a string list that that match certain pattern?
On Fri, Nov 6, 2009 at 3:05 AM, Diez B. Roggisch <deets at nospam.web.de> wrote: > Peng Yu schrieb: >> >> Suppose I have a list of strings, A. I want to compute the list (call >> it B) of strings that are elements of A but doesn't match a regex. I >> could use a for loop to do so. In a functional language, there is way >> to do so without using the for
2004 Jul 16
1
labels for 3d Plots
High! How can I add variable labels (rownames for instance) to a plot created with ‚clouds’ ( clouds(dim3~dim1*dim2)) – package lattice? Thanks in advance! Martina Renninger [[alternative HTML version deleted]]