similar to: Faster way of binding multiple rows of data than rbind?

Displaying 20 results from an estimated 2000 matches similar to: "Faster way of binding multiple rows of data than rbind?"

2011 Apr 24
2
How to erase (replace) certain elements in the data.frame?
Hello R-world, Please, help me to get round my little mess I have a data.frame in which I'd rather like some values to be NA for the future imputation process. I've come up with the following piece of code: random.del <- function (x, n.keeprows, del.percent){ n.items <- ncol(x) k <- n.items*(del.percent/100) x.del <- x for (i in (n.keeprows+1):nrow(x)){ j <-
2019 Jul 19
1
difficulty with sanitizer using bigmemory
Dear all, bigKRLS, which has been on CRAN for a couple of years, had to be pulled recently due to what seems to be a sanitizer issue stemming from its use of bigmemory. bigKRLS works fine (we?ve used it ourselves on many different platforms and have had over 15,000 downloads without an end user reporting difficulties because of this issue). Unfortunately, we have been unable to reproduce the
2005 May 25
3
Rounding fractional numbers to nearest fraction
Hi all, I've got a matrix of fractional data that is all positive and greater than zero that I would like to "loosely" classify, for lack of a better word. It looks something like this : 1.07 1.11 1.27 1.59 0.97 0.76 2.23 0.98 0.71 0.88 1.19 1.02 What I'm looking for is a way to round these numbers to the nearest 0.25, i.e. the above matrix would be
2001 Nov 05
1
Why doesn't outer work?
Hello I'm a population ecologist and use R for all my stats and modelling. Recently I have been using R to numerically solve integral projection models. This involves constructing several large matrices. The current code by Easterling (Size-specific sensitivity: Applying a new structured population model. Ecology, 2000, 81, 694-708) uses nested loops to construct the matrices. To speed up the
2005 Oct 03
3
Problem building/checking library that requires input from user
Hi all, I've got a package i've written that i am trying to check, build, and install. This is my 1st time doing this, so apologies in advance... ;) The package that I've written requires input from the user. It needs to know sample sizes and then runs some calcs, (sample sizes are just integers), and it gets this info from the user as num_reps <- readline("How many reps
2011 Jan 16
1
Memory issues
Hi, I have read several threads about memory issues in R and I can't seem to find a solution to my problem. I am running a sort of LASSO regression on several subsets of a big dataset. For some subsets it works well, and for some bigger subsets it does not work, with errors of type "cannot allocate vector of size 1.6Gb". The error occurs at this line of the code: example <-
2005 Oct 11
4
Any way to add to data frame saved as .rData file?
Hi all, I've got a script that generates a few moderate-size data frames, and then puts them together into one big data frame at the end in order to write that data frame to disk, so that it may be re-opened later on... I'm trying to trim down memory requirements in this script, so I was wondering if there was any way to append to a data frame already saved on disk (just like
2005 Jul 11
2
Isolating string containing only file name from complete path
Hi all, What I'd like to do is to is to be able to extract a string corresponding to only the file name from a string containing the complete path, i.e. from the following path string: "/Users/ken/Desktop/test/runs/file1" I would like to end up with: "file1" This would be most ideally done in a platform-independent way. Thanks in advance, -Ken
2007 Dec 08
2
NAMESPACE choices for exporting S4 methods
We are building a package, and want to create S4 methods for both head and mean for our own BigMatrix class. Following the recommendation in "Writing R Extensions" we use exportMethods instead of export in NAMESPACE (this is described as being "clearer"). This works for head, but not for mean. Obviously we importFrom(utils, head), but don't need to do this for mean,
2006 Jan 23
3
ordering a data frame to same order as a chr vector
Hi all, I've got a data frame that has an identical column to a chr vector. I would like to use the chr vector to order the rows of the data frame to be identical to the order in the chr vector (the contents of the chr vector are completely identical to one col of the data frame), but this is proving trickier than it sounds.. Any help would be much obliged, -Ken
2011 Jun 24
1
Installation of bigmemory fails
Hello All, I tried to intall the bigmemory package from a CRAN mirror site and received the following output while installing. Any idea what's going on and how to fix it? The system details are provided below. --------------------- begin error messages ----------------------- * installing *source* package 'bigmemory' ... checking for Sun Studio compiler...no checking for
2009 Mar 16
2
FW: Select a random subset of rows out of matrix
Dear all, I have a large dataset (N=100,000 with 89 variables per subject). This dataset is stored in a 100.000 x 89 matrix where each row describes one individual and each column one variable. What is the easiest way of selecting a subset of let's say 1.000 individuals out of that whole matrix? Thanks, Michael Michael Haenlein Associate Professor of Marketing ESCP-EAP European School of
2005 Apr 08
1
Princomp$Scores
Hi all, I was hoping that someone could verify this for me- when I run princomp() on a matrix, it is my understanding that the scores slot of the output is a measure of how well each row correlates (for lack of a better word) with each principal component. i.e. say I have a 300x6 log2 scaled matrix, and I run princomp(). I would get back a $scores slot that is also 300x6, where each value
2013 Jan 14
1
ginv / LAPACK-SVD causes R to segfault on a large matrix.
Dear R-help list members, I am hoping to get you help in reproducing a problem I am having That is only reproducible on a large-memory machine. Whenever I run the following lines, get a segfault listed below: *** caught segfault *** address 0x7f092cc46e40, cause 'invalid permissions' Traceback: 1: La.svd(x, nu, nv) 2: svd(X) 3: ginv(bigmatrix) Here is the code that I run:
2005 Feb 08
4
Renaming columns in data.frame, inserting/removing columns from data.frame
Hello, I'm hoping that there is an easier way to rename columns in a data frame other than by using the names() assignment, which requires you to type in all the column names at once for a data.frame, in the case that I simply want to rename a single column in a data frame. Also, is there an easy way to move columns in a data frame around relative to the other columns? Thanks in
2005 Jun 14
5
load ing and saving R objects
Does anyone know a way to do the following: Save a large number of R objects to a file (like load() does) but then read back only a small named subset of them . As far as I can see, load() reads back everything. The context is: I have an application which will generate a large number of large matrices (approx 15000 matrices each of dimension 2000*30). I can generate these matrices using an
2012 Sep 13
0
bigmatrix and irlba
Hello, good mornig, i have one questions, anybody know how to calculate svd of a matrix of the library bigmatrix with library irlba? thanks [[alternative HTML version deleted]]
2012 Feb 29
0
Question about tables in bigtabulate
I have a large file backed big. matrix, with millions of rows and 20 columns. The columns contain data that I simply need to tabulate. There are a few dozen unique values. and I just want a frequency count Test code with a small "big" matrix. library(bigmemory) library(bigtabulate) test <- big.matrix(nrow = 100, ncol = 10) test[,1:3]<- sample(150) test[,4:6]<-
2010 Aug 05
1
rbind on data.frame that contains a column that is also a data.frame
Hi, The following was already a topic on r-help, but after understanding what is going on, I think it fits better in r-devel. The problem is this: When a data.frame has another data.frame in it, rbind doesn't work well. Here is an example: -- > a=data.frame(x=1:10,y=1:10) > b=data.frame(z=1:10) > b$a=a > b z a.x a.y 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5
2006 May 11
4
data input strategy - lots of csv files
Good morning, I have currently 63 .csv files most of which have lines which look like 01/06/05,23445 Though some files have two numbers beside each date. There are missing values, and currently the longest file has 318 rows. (merge() is losing the head and doing runaway memory allocation - but thats another question - I'm still trying to pin that issue down and make a small repeatable