similar to: subsetting of a data.frame

Displaying 20 results from an estimated 10000 matches similar to: "subsetting of a data.frame"

2009 Jan 06
2
Drawing from an empirical distribution
Hi All, Does anybody know if there is a simple way to draw numbers from an empirical distribution? I know that I can plot the empirical cumulative distribution function this easy: plot(ecdf(x)) Now I want to pick a number between 0 and 1 and go back to domain of x. Sounds simple to me. Any suggestion? Thank you, Your culprit (everybody needs a culprit) -- View this message in context:
2008 Oct 21
1
Paddding an integer with zeros
Hello List, Can anybody point me to a number-to-string formatting function? I need to convert, say, 12 to 00012. I tried format() but its too stubborn: it seems to only pad with spaces. Thank you, Your culpritNr1 -- View this message in context: http://www.nabble.com/Paddding-an-integer-with-zeros-tp20095300p20095300.html Sent from the R help mailing list archive at Nabble.com.
2008 Oct 15
2
R: "in-place" appending to a matrix.
Hello fellow R sufferers, Is there a way to perform an appending operation in place? Currently, the way my pseudo-code goes is like this for (i in 1:1000) { if (some condition) { newRow <- myFunction(myArguments) X <- rbind(X, newRow) # <- this is the bottleneck!! } } As you can see, it works but as the matrix X gets the size of a few million rows, the
2009 Mar 10
1
system() not accepting strings from cat()
Hi again R-ists, How do you construct a string that you can pass to system()? For instance. Say I do > system("echo Hello!") Hello! That works. Now the alternative: I need to construct the string like this > a <- "echo" > b <- "Hello!" > c <- "\n" > cat(a, b, c) echo Hello! Looks nice... but see what happens when I try to use it
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) &
2018 Jan 20
3
DNS issues after upgrade
Hi, Last evening we upgraded one of our 4 Domain Controllers from 4.6.5 to 4.7.1 and all of a sudden the DNS resolution issue started. We are using BIND9_DLZ back end. This server we had upgraded has all 7 FSMO Roles. Some time back we upgraded the other 3 servers from version 4.6.5 to 4.7.1 and there was no issue at all. I have also observed a very peculiar behaviour that is all of a
2013 Apr 29
2
Adding elements in data.frame subsets and also subtracting an element from the rest elements in data.frame
Dear R forum I have a data.frame as cashflow_df = data.frame(instrument = c("ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC","ABC", "ABC", "PQR", "PQR",
2009 Jan 09
1
Calling R functions from Python
All- Thanks in advance for your help. I'm trying to call R function using Python in a windows environment and have downloaded the Rpy library however it doesn't appear to work with R 2.7.2. Does anyone know if a new version of Rpy exists for windows that will work with R and where it can be downloaded from? Here's an example of the error I'm getting:
2009 Mar 06
1
a general question
Hi everyone, Although this question is more related to ChIP and ChIP-seq, it could be probably anchored in a more general statistical context. The question is : what method is better to assess the significance of the change in a signal (the signal can be DNA binding, for instance) given the background and 2 conditions. <. condition1 (eg no treatment) : background = 1;
2005 Jan 14
3
summing subsets of rows matrices
I have a large data matrix (4460X3500) and I want to sum row subsets in groups of 10 (bin). Is there an efficient way to do this in R without using loops. Looping takes forever to perform this task! For example suppose we have the matrix > matrix(1:12,6,2) [,1] [,2] [1,] 1 7 [2,] 2 8 [3,] 3 9 [4,] 4 10 [5,] 5 11 [6,] 6 12 my problem is to sdum for
2010 Sep 23
1
OpenVPN tunnel and one-way audio - Do I still need a SIP proxy? (bruce bruce)
> I don't think it's an endpoint issue. I think the SIP packet headers get > over-written by the tunnel (openvpn) protocol. I'd be rather astonished if OpenVPN itself were responsible for this. As far as I know, OpenVPN doesn't do higher-level-protocol rewriting of any sort. It just provides the "bit pipe" through the tunnel. I'd suggest several other
2002 Dec 04
3
can this happen?
This is basically a question about where to start looking for a problem. I have a program that gives slightly different results on two Windows computers. It is a reasonably complicated numerical optimisation, with iterative calls to optim(). The two computers both run Windows 2000. On each computer I get the same results in two different versions of R (1.5.1 and 1.6.0 on one, 1.5.1 and 1.6.1
2011 Dec 28
1
Subsetting a data frame vs. subsetting the columns
Hi all, There seems to be rather a large speed disparity in subsetting when working with a whole data frame vs. working with just columns individually: df <- as.data.frame(replicate(10, runif(1e5))) ord <- order(df[[1]]) system.time(df[ord, ]) # user system elapsed # 0.043 0.007 0.059 system.time(lapply(df, function(x) x[ord])) # user system elapsed # 0.022 0.008 0.029
2000 Apr 12
4
For wishlist: sanity checks for subsets in lm, glm (PR#
Martyn Plummer <plummer@iarc.fr> writes: > On 12-Apr-00 Peter Dalgaard BSA wrote: > > Might be a good idea. Mind you, Splus 3.4 does exatly the same thing, > > and I'm a little worried that the uniqueness assumption might kill > > some bootstrapping applications: > > > > glm(y ~ x, data=test.data, subset=sample(seq(along=y),replace=T)) > > Splus
2018 Apr 24
2
[FORGED] Extracting specified pages from a lattice ("trellis") object.
Hi I think the subsetting works by giving you the panels for the corresponding levels of the conditioning variable(s). Note that, if there is more than one conditioning variable, you will need more than one subsetting index. For example, taking this plot with two conditioning variables and 12 panels in total ... dotplot(variety ~ yield | year * site, data=barley) ... this produces three
2008 Oct 21
2
Inserting a new row in a matrix
Hi guys, I need to insert a row to a matrix in a for loop. I have matrix named "Avg" which is a 5x4 matrix of zeros. I have a file named "A"(4 rows,14 columns) which I make a sample of it 5 times. each time I get the mean for each column and put the result in the "Avg" matrix. this is my code: Avg=matrix(0,5,4) > > for(i in 1:5){ + res=(A[sample(nrow(A),
2009 Feb 10
2
Bug in subsetting data frame (PR#13515)
Full_Name: Xin Lee Version: 2.8.0 OS: Windows XP Submission from: (NULL) (193.200.150.23) Dear developer I discover annoying bug in subsetting data frame. Here is reproducable examples: > data.frame <- data.frame(x = runif(5), y = runif(5), row.names = c('a','b','c','d','e') > subset <- data.frame['x'] > subset['a',] work
2016 Sep 19
0
Subsetting issue in model.frame with na.omit
Running R version 3.3.1 (2016-06-21) Bug in Your Hair I have discovered an issue with model.frame() with regard to its implementation of the na.action argument. This impacts the gam package. We are expecting the last thing to happen in model.frame() is that it runs na.action on the frame it has produced. In the example below, we use "na.action=na.omit", which calls for subsetting
2010 Jan 29
2
Explanation w.r.t. rbind, please!
This is what I tried: > num.vec <- c(12.34,56.78,90.12,34.56) > names(num.vec)<-c("first","second","third","fourth") > num.vec first second third fourth 12.34 56.78 90.12 34.56 > seq<-(1:4) > num.mat<-rbind(num.vec,seq) > num.mat first second third fourth num.vec
2009 Sep 03
1
Subsetting Data Frame based On Specified K Value
I have a data that looks like this: http://dpaste.com/88988/plain/ How can I extract/subset the data frame based on selected uniq ID. Let's say I want the first K uniq ID. I want to be able to specify the parameter "K" here, (i.e. given K=3, we hope to extract dat$V2 = 0,1,2). I'm stuck with this construct: dat <- read.table("http://dpaste.com/88988/plain/") dats