similar to: replace column headers

Displaying 20 results from an estimated 1200 matches similar to: "replace column headers"

2013 Jul 17
2
error message in gev
  Hi r-users,   I would like to use gev and my data (annual rainfall ) is as follows:   > head(dat,20) A B C D E F G H I J 1 45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0 2 50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4 58.3 3 41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5 45.6 4 50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7 38.3 5 39.3 30.6 46.9 23.8 25.8
2009 Aug 28
6
Google's R Style Guide
Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? Thanks, Esmail ps: Reminds me of PEP 8 for Python http://www.python.org/dev/peps/pep-0008/ Maybe not that surprising since Python is also one of the main languages used by Google.
2013 Jan 03
5
splitting matrices
Dear useRs, i want to split a matrix having 1116rows and 12 columns. i want to split that matrix into 36 small matrices each having 12 columns and 31 rows. The big matrix should be splitted row wise. which means that the first small matrix should copy values which are in first 31 rows and 12 columns of the big matrix. similarly 2nd small matrix should contain values from 32nd to 63rd row of the
2011 Oct 24
3
Important Security Announcement: AltNames Vulnerability [new version of puppet]
We have discovered a security vulnerability (“AltNames Vulnerability”) whereby a malicious attacker can impersonate the Puppet master using credentials from a Puppet agent node. This vulnerability cannot cross Puppet deployments, but it can allow an attacker with elevated privileges on one Puppet-managed node to gain control of any other Puppet-managed node within the same infrastructure. All
2009 Apr 19
3
flip certain bits in vector
I have a string of binary values, and I would like to flip certain bits in a set of positions. Let's say the vector p contains position [1, 3, 5, 7] vector b contains bits [1, 0, 1, 0, 1, 0, 1, 0, 1, 0] result r should be [0, 1, 0, 0, 0, 0, 0, 0, 1, 0] in pseudo code this would be something like --- r = c() for (i in 1:10) if (i in p) r = c(r, flip[i]) r ----
2008 Jun 12
3
Adding new columns to (output) data - e.g., read 5 cols write 8
Hello, I have the following task I'd like to accomplish: A file contains 5 columns of data (several hundred rows), let's call them a, b, c, d and e (ie these are their column headers) I also have a set of definitions, e.g., f = a + b g = a * 3 h = c + d etc. I would like to write out a new .rda file that contains columns a b c d e f g h etc. I.e. , the original data plus new columns
2008 May 09
2
which.max2()
Hello, which.max() only returns one index value, the one for the maximum value. If I want the two index values for the two largest values, is this a decent solution, or is there a nicer/better R'ish way? max2 <-function(v) { m=which.max(v) v[m] = -v[m] m2=which.max(v) result=c(m, m2) result } Seems to work ok. Thanks, Esmail
2009 Apr 26
4
comparing matrices
I'm trying to compare two matrices made up of bits. doing a simple comparison of matA == matB yields this sort of output. [,1] [,2] [,3] [,4] [,5] [,6] [1,] FALSE TRUE FALSE TRUE TRUE FALSE [2,] TRUE TRUE TRUE TRUE TRUE TRUE [3,] FALSE TRUE FALSE FALSE FALSE TRUE [4,] FALSE TRUE TRUE FALSE FALSE FALSE [5,] TRUE TRUE TRUE TRUE FALSE FALSE [6,] TRUE TRUE
2008 May 07
1
Automatically generating new column names (and columns)
Once again I need to tap into the collective knowledge here. Let's say I have the following columns and data below Y X1 X2 X3 X4 I would like to generate additional new columns and column names (ie the data would be squared - and I'd like the column names to reflect this) like: Y X1 X2 X3 X4 X1^2 X2^2 X3^2 X4^2 I believe I can compute the values correctly with the code below, but I
2010 Feb 24
2
sprintf + integer(0) problem
Hello all, I am stuck with R v2.8.0 under Linux for the time being and I am running into a small problem that doesn't exist under 2.9.x and 2.10.x with sprintf. If I have the following code segment to help me determine the column number for a specific column header/label: nn = names(Dataset) s = "Group" c = which(nn==s) cat(sprintf('found %s in col %d\n', s, c))
2001 Jan 14
2
Help
Dear sir, I am using R in windows. I want to extend R Memory size. I use the following command, but unfortunately it doesn't work. -- vsize=15M --nsize=1000K Your help is appreciated. Thanks, Esmail Amiri. __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
2012 Jul 06
4
differences between survival models between STATA and R
Dear Community, I have been using two types of survival programs to analyse a data set. The first one is an R function called aftreg. The second one an STATA function called streg. Both of them include the same analyisis with a weibull distribution. Yet, results are very different. Shouldn't the results be the same? Kind regards, J -- View this message in context:
2008 May 06
2
building a formula string bit by bit ..
Hello, Still a newbie with R, though I have learned a lot from reading this list. I'm hoping someone can help with this question: I have two vectors, one for variables, and one for bits. I want to build a string (really a formula) based on the values in my vector of 1s and 0s in bits. If I have a one, I want to include the corresponding entry in the vars vector, otherwise ignore it. Of
2009 Feb 18
2
how to randomly eliminate half the entries in a vector?
(sorry if this is a duplicate-problems with posting at my end) ---- Hello all, I need some help with a nice R-idiomatic and efficient solution to a small problem. Essentially, I am trying to eliminate randomly half of the entries in a vector that contains index values into some other vectors. More details: I am working with two strings/vectors of 0s and 1s. These will contain about 200
2010 Feb 15
1
argh .. if/else .. why?
Hello, would someone please help explain the following inconsistency in the if/else statement to me? The format of the if/else #3 below is ok, but if/else #1 is not? (I get an "unexpected else" type error.) In order for it to work I have to use if/else #2 Thanks .. maybe there is some reason for this, but this looks very inconsistent to me. R version 2.10.1 (2009-12-14) Ubuntu 9.04
2008 Jun 11
3
searching for specific row in matrix
Hi, I have matrix of bits and a target vector. Is there an efficient way to search the rows of the matrix for the target? I am interested in the first row index where target is found. Example: > source("lookup.R") [,1] [,2] [,3] [,4] [,5] [1,] 1 0 1 1 0 [2,] 1 1 0 1 0 [3,] 0 0 1 0 0 [4,] 1 0 0 1 1 [5,]
2009 May 23
1
optimizing function over x,y
Hello all, I would like to maximize or minimize a given math function over a specific set of values. I was checking out Wolfram Alpha (http://www70.wolframalpha.com/) and it can do simple optimization problems in math, such as maximize 15*x - x**2 over 0 to 15 (http://www70.wolframalpha.com/input/?i=maximize+15*x+-+x**2+over+0+to+15) which finds the maximum value and input for x in
2010 Mar 11
2
Comparing matrices
Hello all, I have two matrices, pop and pop2, each the same number of rows and columns that I want to compare for equality. I am concerned about efficiency in this operation. I've tried a few things without success so far. Doing something simple like: if (pop==pop2) { cat('equal') } else { cat('NOT equal') } results in the warning: 1: In if (pop == pop2) { : the
2009 Apr 27
3
Formatting numbers
I've been trough the R documentation for about half an hour and it's not clear to me how to do this: I need to format to character a series of integers from 1 to 1000, and I like them to look like "0001" "0002", "0059", "0123" and so on. Padded with zeroes to have four digits. Cheers! Mario. r-help-request at r-project.org wrote: > Send
2009 Apr 26
3
3 questions regarding matrix copy/shuffle/compares
Hello all, I have the following function call to create a matrix of POP_SIZE rows and fill it with bit strings of size LEN: pop=create_pop_2(POP_SIZE, LEN) I have 3 questions: (1) If I did keep_pop[1:POP_SIZE] == pop[1:POP_SIZE] to keep a copy of the original data structure before manipulating 'pop' potentially, would this make a deep copy or just shallow? Ie