similar to: Splitting a vector into equal groups

Displaying 20 results from an estimated 6000 matches similar to: "Splitting a vector into equal groups"

2010 Dec 17
1
[Fwd: adding more columns in big.matrix object of bigmemory package]
Hi, With reference to the mail below, I have large datasets, coming from various different sources, which I can read into filebacked big.matrix using library bigmemory. I want to merge them all into one 'big.matrix' object. (Later, I want to run regression using library 'biglm'). I am unsuccessfully trying to do this from quite some time now. Can you please
2009 May 18
2
intermediate iterations of stepwise regression
Hi all, I am performing a stepwise regression by running the "step" function on an "lm" object. Now I want to save the intermediate iterations. I know the argument trace=T will print it on the console, but I rather want to assign it to some R object or may be output it in a CSV or text file. Any help will be appreciated. Regards Utkarsh
2009 Jun 30
4
R version-2.9.1 for Linux
Hi All, I am currently using R version 2.8.1 on linux cent os 4.4 (i386) and want to upgrade to version 2.9.1. It seems to me that version-2.9.1 is it not for my OS. Am I right? Regards Utkarsh [[alternative HTML version deleted]]
2009 Jun 02
2
bigmemory - extracting submatrix from big.matrix object
I am using the library(bigmemory) to handle large datasets, say 1 GB, and facing following problems. Any hints from anybody can be helpful. _Problem-1: _ I am using "read.big.matrix" function to create a filebacked big matrix of my data and get the following warning: > x = read.big.matrix("/home/utkarsh.s/data.csv",header=T,type="double",shared=T,backingfile
2009 Nov 23
3
FUN argument to return a vector in aggregate function
Hi All, I am currently doing the following to compute summary statistics of aggregated data: a = aggregate(warpbreaks$breaks, warpbreaks[,-1], mean) b = aggregate(warpbreaks$breaks, warpbreaks[,-1], sum) c = aggregate(warpbreaks$breaks, warpbreaks[,-1], length) ans = cbind(a, b[,3], c[,3]) This seems unnecessarily complex to me so I tried > aggregate(warpbreaks$breaks, warpbreaks[,-1],
2009 Jun 16
1
Testing if all elements are equal in a vector/matrix
Hi All, There are several replies to the question below, but I think there must exist a better way of doing so. I just want to check whether all the elements of a vector are same. My vector has one million elements and it is highly likely that there are distinct elements in the first few itself. For example: > x = c(1,2,rep(1,100000)) I want the answer as FALSE, which is clear from the
2009 May 27
3
Defining functions - an interesting problem
I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And please don't spend your time in finding an alternate way of doing the same as the following does not exactly represent my function. I am only interested in a good explanation) > f1 =
2009 Apr 30
2
problem in as.date
I never understood that why is the value returned by as.date function in the library(survival) never matches with the description given in the help file: Following is the extract from ?as.date Description: Converts any of the following character forms to a Julian date: 8/31/56, 8-31-1956, 31 8 56, 083156, 31Aug56, or August 31 1956. Usage: as.date(x, order = "mdy", ...)
2009 Dec 24
3
help in merging
Hi All, I want to "merge" two datasets by column "ID" and I don't want the result to be sorted by "ID". I am doing the following: > z = merge(x, y, by = "ID", sort=F) The result is not sorted by "ID". But (as oppose to what I expected) it is not even in the original order of either "x" or "y". Can
2017 Aug 10
2
Import selected columns from sas7bdat file
Hello everyone, I want to import data from huge sas files with 100s of columns. The good thing is that I am only interested in a few selected columns. Is there any way to do that without loading the full dataset. I have tried two functions: (1) read.sas7bdat *[from library 'sas7bdat']*, and (2) read_sas *[from library 'haven']. *But couldn't find what I am looking for. Best
2008 Mar 25
5
reading Excel file
Hi R, I have an excel file in which the third column is "date" and others are "character" and "numeric". Number of columns are 12 If I use this to read the file in R: x = read.xls("D:\\file.xls") The problem is that my date column is read in julian dates. So I am using: x = read.xls("D:\\file.xls",
2008 Jul 16
1
NAMESPACE vs internal.Rd
Hi the list, When we use package.skeleton, it create some file in the man directorie. - If we use package.skeleton with namespace=FALSE, it create a file toto-internal.Rd - If we use package.skeleton with namespace=TRUE, it does not create the file toto-internal.Rd Why is that ? Christophe
2008 Oct 29
2
definition of a function
Hello, R subscribers. I would like to define a function like this one: Fun <- function(x) sin(x)/x with value 1 at x=0. How can I do that? Is there a way to plot it "symbolically", without using x as a vector? e.g. x <- seq(from=-10, to=10, length=100) plot(x, Fun(x)) Thank you in advance.
2009 Feb 22
2
How to reshape this data frame from long to wide ?
I tried cast and melt in reshape package, but still can't convert this data frame m m [,1] [,2] [1,] "A" "1" [2,] "A" "2" [3,] "B" "3" to this form. m1 [,1] [,2] [1,] "A" "B" [2,] "1" "3" [3,] "2" NA Please help. [[alternative HTML version deleted]]
2009 May 27
1
Constrained fits: y~a+b*x-c*x^2, with a,b,c >=0
I wonder whether R has methods for constrained fitting of linear models. I am trying fm<-lm(y~x+I(x^2), data=dat) which most of the time gives indeed the coefficients of an inverted parabola. I know in advance that it has to be an inverted parabola with the maximum constrained to positive (or zero) values of x. The help pages for lm do not contain any info on constrained fitting. Does anyone
2008 Dec 05
3
Logical inconsistency
Dear colleagues Please could someone kindly explain the following inconsistencies I've discovered when performing logical calculations in R: 8.8 - 7.8 > 1 > TRUE 8.3 - 7.3 > 1 > TRUE Thank you, Emma Jane [[alternative HTML version deleted]]
2008 Feb 15
2
Quadratic Programming
Hi, I am using solve.QP (from quadprog) to solve a standard quadratic programming problem: min_w -0.5*w'Qw st ... I would like solve.QP to do two things: 1) to start the optimization from a user-supplied initial condition; i.e., from a vector w_0 that satisfies the constraints, and 2) to return the values of the lagrange multiplieres associated with the constraints. I did not find an obvious
2008 Dec 02
1
r2 for lm() with zero intercept
Hello list I'm a little confused about the R2 and adjusted R2 values reported by lm() when I try to fix an intercept. When using +0 or -1 in the formula I have found that the standard error generally increases (as I would expect) but the R2 also increases (which seems counter intuitive). I've pasted a short test script below to illustrate. I do realise that many will say I shouldn't be
2008 Dec 01
2
Warning: missing text for item ... in \describe?
Hello: What might be the problem generating messages like "Warning: missing text for item ... in \describe" with "R CMD check" and "R CMD install"? With the current version of "fda" on R-Forge, I get the following: Warning: missing text for item 'fd' in \describe Warning: missing text for item 'fdPar' in \describe
2009 May 25
2
inconsistency in ?factor
In the almost current development version (2009-05-22 r48594) and also in https://svn.r-project.org/R/trunk/src/library/base/man/factor.Rd ?factor contains (compare the formulations marked by ^^^^^^) \section{Warning}{ The interpretation of a factor depends on both the codes and the \code{"levels"} attribute. Be careful only to compare factors with the same set of levels (in