similar to: problems subsetting

Displaying 20 results from an estimated 300 matches similar to: "problems subsetting"

2012 Apr 21
2
using "factor" to eliminate unused levels without dropping other variables
Hello, I have been banging my head against the wall trying to figure out this seemingly simple problem with no success. I'm hoping that one or some of you can help. Here is the code I am trying to use: #importing data data.file <-read.csv("/file/location", header=TRUE, sep = ",") #selecting a subset of data based on variable "Sample" data.subset1 <-
2011 Feb 24
1
Creating objects (data.frames) with names stored in character vector
Hello, I'm fairly new to R. I'm a chemist, not a programmer so please bear with me. I have a large data.frame that I want to break down (subset) into smaller data.frames for analysis. I would like to give the data.frames descriptive names which I have stored in a character vector. My original thought was that I want the subsets to show up as individual objects, but haveing them stored
2009 Sep 13
1
Manage an unknown and variable number of data frames
Hi, In the code below I create a small data.frame (dat) and then cut it into different groups using CutList. The lists in CutList allow to me choose whatever columns I want from dat and allow me to cut it into any number of groups by changing the lists. It seems to work OK but when I'm done I have a variable number of data frames what I need to do further operations on and I don't know
2010 Feb 17
2
Is the aggregate function the best way to do this?
Hi, I''m having a dataframe ''Subset1'' with a number of factor variables and 160 numerical variables Now I want to make sums for all rows that have the same values for the different factor variables, except for the factor variables: VAR1,VAR2,VAR3 who may have the same values. With the formula given below this works great, but in a situation with 15000 rows and 13
2004 Dec 14
1
Multiple options for a package
Hi R-devel, I am facing a situation where the number of options I would like to propose to the user is somewhat big (and could easily increase more and more as I will code up a little more - even coming to a point where an user should be able to implement his own options). What we have to handle options is the couple: options(par=value) and getOption("par") I was aking myselft what
2007 Dec 20
1
custom subset method / handling columns selection as logic in '...' parameter
Dear R-helpers & bioconductor Sorry for cross-posting, this concerns R-programming stuff applied on Bioconductor context. Also sorry for this long message, I try to be complete in my request. I am trying to write a subset method for a specific class (ExpressionSet from Bioconductor) allowing selection more flexible than "[" method . The schema I am thinking for is the following:
2007 Feb 09
2
heatmap color specification
hi, I have a positive integer matrix like: test<-matrix(c(1,2,2,2,2,1,1,2,3),3) and based on the distant function I made like this: generateDistMat<-function (target) { n <- nrow(target) rn <- rownames(target) distM <- matrix(NA, n, n) diag(distM) <- 0 for (i in 1:(n - 1)) for (j in (i + 1):n) { distM[i, j] <- length(which(target[i, ] !=
2015 Jul 27
4
Como modificar valores en un data frame
Estimad en s, querĂ­a realizar una consulta Dado un data frame llamado aves, como puedo sustiuir las variables area, dist y distm por sus logaritmos en base10 y volver a crear un data frame? Muchas gracias Saludos Susana [[alternative HTML version deleted]]
2009 Nov 22
4
Do you keep an archive of "useful" R code? and if so - how?
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091122/430e3297/attachment-0001.pl>
2007 Dec 29
1
COMPAR.GEE error with logistic model
Hello, I am trying to run the APE program COMPAR.GEE with a model containing a categorical response variable and a mixture of continuous and categorical independent variables. The model runs when I have categorical (binary) response and two continuous independent variables (VAR1 and VAR2), but when I include a categorical (binary) independent variable (VAR3), I receive the following output with
2012 Jun 20
2
[LLVMdev] Back-end: how to test all lowering condition
Dear All, I am working on a back-end implementation for a new architecture which is provided with its own assembler. I am currently capable of writing most of the lowering process to generate a decent assembly code. Under certain circumstances, i.e. depending on the C code, some IR instructions generate a Selection DAG for which I am not implementing a proper lowering, thus resulting in the
2007 Jul 12
1
[[.data frame and row names
Hi, I'm wondering why indexing a data frame by row name doesn't work with [[. It works with [: > sw <- swiss[1:5,1:2] > sw["Moutier", "Agriculture"] [1] 36.5 but not with [[: > sw[["Moutier", "Agriculture"]] Error in .subset2(.subset2(x, ..2), ..1) : subscript out of bounds The problem is really with the row name (and not
2012 Jun 20
0
[LLVMdev] Back-end: how to test all lowering condition
On Wed, Jun 20, 2012 at 01:50:51PM +0000, Christian Nastasi wrote: > Dear All, > I am working on a back-end implementation for a new architecture which is provided with its own assembler. > I am currently capable of writing most of the lowering process to generate a decent assembly code. > Under certain circumstances, i.e. depending on the C code, some IR instructions generate a
2013 Feb 26
1
cutreeDynamic error
I am having difficulty getting the dynamic tree cut package to work. Given the data table "myddtable" LengthPlaceColorAge5HRed224ABlue205WGreen243GRed222GBlue236WGreen255ARed194H Blue23 I created a similarity matrix using DAISY and Gower metric and specified Place and Color columns as characters (since they are categorical variables) > dd.daisy<-daisy(myddtable, metric =
2012 Jun 20
1
[LLVMdev] Back-end: how to test all lowering condition
Dear Tom, thank you for your reply. What you suggest is something I was considering doing, however there still no solution to my Problem2. How do I test the ISD instructions if I can only write IR instructions? -----Original Message----- From: Tom Stellard [mailto:thomas.stellard at amd.com] Sent: Wednesday, June 20, 2012 4:14 PM To: Christian Nastasi Cc: llvmdev at cs.uiuc.edu Subject: Re:
2020 Jun 17
2
subset data.frame at C level
Hi, Hope you are well. I was wondering if there is a function at C level that is equivalent to mtcars$carb or .subset2(mtcars, "carb"). If I have the index of the column then the answer would be VECTOR_ELT(df, asInteger(idx)) but I was wondering if there is a way to do it directly from the name of the column without having to loop over columns names to find the index? Thank you Best
2010 Oct 07
2
text/mtext axis labels on graphs
Hello everyone I have problem with axis labels on graphs, I have my code as below: plot(0,0,xlim=c(1,ncol(PA)),ylim=c(1,nrow(PA)),main="Stratigraphic Range",xlab="Time Bins",ylab="Taxa",cex.axis=1.5,cex.lab=2,cex.main=2.5,mgp=c(5,1.5,0),xaxt="n") text(1:(length(strat_name)), y= 0, adj=1, srt=45,labels=strat_name,xpd=TRUE, cex=1) #adds text to x
2007 Oct 14
1
bug (?) in [.data.frame with matrix-like indexing
Consider in R-2.6.0 (also R-patched from yesterday): iris[1, c(TRUE, FALSE, FALSE, FALSE, FALSE)] ## Error in .subset2(xx, j) : recursive indexing failed at level 2 iris[1, c(FALSE, FALSE, FALSE, FALSE, TRUE)] ## Error in .subset2(xx, j) : attempt to select less than one element i.e. matrix-like indexing on data.frames, one logically-indexed dimension with only one value TRUE in it. It is
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster for subscripting rows of large data frames; it avoids calling duplicated(rows) if there is no need to check for duplicate row names, when: i is logical attr(x, "dup.row.names") is not NULL (S+ compatibility) i is numeric and negative i is strictly increasing "[.data.frame" <- function (x, i, j,
2018 Aug 24
5
True length - length(unclass(x)) - without having to call unclass()?
Is there a low-level function that returns the length of an object 'x' - the length that for instance .subset(x) and .subset2(x) see? An obvious candidate would be to use: .length <- function(x) length(unclass(x)) However, I'm concerned that calling unclass(x) may trigger an expensive copy internally in some cases. Is that concern unfounded? Thxs, Henrik