similar to: selecting a subset of a matrix based on a value occurring in 5 records

Displaying 20 results from an estimated 2000 matches similar to: "selecting a subset of a matrix based on a value occurring in 5 records"

2008 Dec 16
8
sliding window over a large vector
Hi all, I have a very large binary vector, I wish to calculate the number of 1's over sliding windows. this is my very slow function slide<-function(seq,window){ n<-length(seq)-window tot<-c() tot[1]<-sum(seq[1:window]) for (i in 2:n) { tot[i]<- tot[i-1]-seq[i-1]+seq[i] } return(tot) } this works well for for reasonably sized vectors. Does
2008 Dec 24
2
Using 'cat' on data frame
Dear all, I have the following data frame: > raw.count Var1 Freq 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 707 2 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC 14 3 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT 3 But why when printint it using 'cat', it doesn't print the desired string "AAA" ? > cat(raw.count$Var1,
2007 Dec 20
2
factor manipulation: edgelist to a matrix?
Hello All, I have had considerable bad luck with attempting the following with for loops. Here is the problem: # Suppose we have a data.frame with the following data, which can be considered a type of edgelist (for those with networks backgrounds): # # V1 V2 # 1 A # 1 A # 1 B # 2 A # 3 C # 3 A # 3 C # 3 B # # I want the output of the function to produce a matrix, such that #each factor of
2012 Feb 20
3
How to determine a subset of a binary strings?
Hi, I need some neat ways of determing a subset of binary strings. For example, x=c(0,0,1), y=c(0,1,1), z=c(0,1,0). So x is a subset of y and z is also a subset of y, but x is not a subset of z. I tried to search R functions and packages but no hits. Any ideas? Best, Jing -- Jing Tang, PhD Senior Researcher Finnish Institute of Molecular Medicine (FIMM) FI-00014 University of
2005 Apr 22
1
density estimation
hello sorry for my english I would like estimate density for multivariate variable,( f(x,y) , f(x,y ,z) for example) ; for calculate mutual information how is posible with R? thanks Bernard Bernard Palagos Unité Mixte de Recherche Cemagref - Agro.M - CIRAD Information et Technologie pour les Agro-Procédés Cemagref - BP 5095 34033 MONTPELLIER Cedex 1 France
2006 Jul 05
4
degrading gracefully - how to tell if JS is enabled?
Is there a RoR best practice wrt determing in a visitor''s browser has JS disabled? Is there even a way to find out? I''ve got a couple of pages in my app that are not going to degrade gracefully at all. I really need to point a visitor who has JS disabled down a seperate path. Any ideas? Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed...
2008 Apr 17
1
Moving from Splus to R: irregular and regular time series
Dear R developpers, I am a user of Splus since many years and I have developped lots of functions to plot graph of data and model results of irregular or regular times series. In Splus regular times series are created using the rts function and irregular time series using the its functions. In both cases, times is given as a numeric vector. There is no problem in plotting a regular and an
2007 Mar 27
1
"Groups" in XYPLOT
I'm not sure I'm barking up the right tree here, but would I need to make use of groups to plot two separate datasets within ONE panel in xyplot? The desired end result is a single xy plot of two separate (but similar in values and ranges). Full code follows, xyplot code at bottom #########Determine Frequencies ##########coastal_slope #needs the maptools package to read ESRI grid
2005 Jan 26
3
Still avoiding loops
Dear all, I have a matrix X with 47 lines and say 500 columns - values are in {0,1}. I'd like to compare lines. For that, I first did: for (i in 1:(dim(X)[1]-1)) for (j in (i+1):dim(X)[1]) { Y <- X[i,]+Y[j,] etc. but, since it takes a long time, I would prefer avoding loops; for that, my first idea was to add this matrix: X1=X[,rep(1:46,46:1)] to this one: res=NULL for (i in
2001 Oct 16
1
Defeating Timing Attacks Patch for OpenSSH 2.9.9p2 and 2.9p2
Hello, In response to the timing analysis attacks presented by Dawn Song et. al. in her paper http://paris.cs.berkeley.edu/~dawnsong/ssh-timing.html we at Silicon Defense developed a patch for openssh to avoid such measures. Timing Analysis Evasion changes were developed by C. Jason Coit and Roel Jonkman of Silicon Defense. These changes cause SSH to send packets unless request not to,
2008 Mar 16
1
optim: why is REPORT not used in SANN?
Hello, I wonder why the control parameter REPORT is not supported by method SANN. Looking into optim.c I found an internal constant: #define STEPS 100 ... and decreasing this to 10 helped me fine-tuning the annealing parameters in an actual problem. Is there any reason why not passing nREPORT to samin and setting something like: STEPS = nREPORT / tmax Thomas P. -- Thomas Petzoldt
2009 Mar 04
1
CRAN package check on MacOS: sh: line 1: gs: command not found
Dear R developers, I recently observed a NOTE on several MaxOS X package checks: sh: line 1: gs: command not found !!! Error: Closing Ghostscript (exit status: 127)! /usr/bin/texi2dvi: thumbpdf exited with bad status, quitting. See for details: http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/simecol-00check.html or
2007 Feb 27
1
interactions and GAM
Dear R-users, I have 1 remark and 1 question on the inclusion of interactions in the gam function from the gam package. I need to fit quantitative predictors in interactions with factors. You can see an example of what I need in fig 9.13 p265 from Hastie and Tibshirani book (1990). It's clearly stated that in ?gam "Interactions with nonparametric smooth terms are not fully
2006 Jun 20
1
Determine the data type of a function to an argument
Hello All: How can I determing the "types" of args passed to an R function? For example, given the following: calculate <- function(...) { args <- list(...) argName = names(args) if (arg1 == character) cat("arg1 is a character") else cat("arg1 is numeric") if (arg2 == character)
2004 Jul 21
3
How to sort TWO columns ?
Dear ALL, I fear my question has already been answered many times before, but I haven't fund that in archives... I am working on spatial datasets and, in most arrays I'm handling, there are two columns dedicated to (x,y)-coords. For different reasons - notably to draw image() plots, I need to have these two columns sorted in increasing order. But sort() and order() seem to apply to
2005 Oct 27
2
F tests for random effect models
Dear R-users, My question is how to get right F tests for random effects in random effect models (I hope this question has not been answered too many times yet - I didn't find an answer in rhelp archives). My data are in mca2 (enc.) : names(mca2) [1] "Lignee" "Pollinisateur" "Rendement" dim(mca2) [1] 100 3 replications(Rendement ~ Lignee *
2005 Jan 21
5
functions not found after installing DBI/RDBI packages
Hi, I would like to be able to use R with a connection to a PostgreSQL database. I am using R 2.0.1 on windows XP. I have tried installing both the DBI and rDBI packages (which is better?) but in either case I run into the same problem - when i try to use either the dbDriver or dbConnect functions i'm told the function couldn't be found. Seems like the packages aren't installing
2003 Sep 12
2
partial mantel
Dear all, Has anyone written R code for partial Mantel Tests- as described for instance in Legtendre & Legendre (1998) ? In other words, in a community ecology analysis, I would like to calculate the correlation between two dissimilarity matrices, controlling for a third distance matrix representing geographical distances between sites. Thanks! Christophe Bouget Biodiversité et gestion des
2008 Dec 03
1
nlminb: names of parameter vector not passed to objective function
Dear R developers, I tried to use nlminb instead of optim for a current problem (fitting parameters of a differential equation model). The PORT algorithm converged much better than any of optim's methods and the identified parameters are plausible. However, it took me a while before spotting the reason of a technical problem that nlminb, in contrast to optim, does not pass names of the
2008 Nov 08
1
plot.hclust with lots of objects
Dear all, The default plotting method for hclust trees looks just fine for few objects like in the example dataset. But when it comes to many features (eg some 1000 and more - I'm trying to visualize clustered microarray data) it renders a tree, that one cannot inspect, because of overlapping text and lines. My question is, is there a way or a plotting parameter for plotting a tree which is