similar to: Change the name of one column ONLY

Displaying 20 results from an estimated 5000 matches similar to: "Change the name of one column ONLY"

2007 Feb 26
1
match() function with a little enhancement
Dear R users, I was wondering if R has a built-in function doing the following : my_match(values_vector,lookup_vector) { for each value of values_vector : if value %in% lookup_vector, then value is unchanged else, value is changed the the closest element of lookup_vector, "closest" meaning "the one that would come just after if we sorted them using order()" } For example :
2007 Oct 26
2
function in R that's equivalent to SQL's "IN"
Hi all, I'm trying to find something like the "==" operator that will work on vectors or something equivalent to SQL's "IN" function. For e.g., if I have: x <- c(1,2,3,4,5) y <- c("apples", "oranges", "grapes", "bananas", "pears") z <- data.frame (x,y) w <- c(2,4,5) I want R to return the values
2011 Feb 18
2
xyplot formula
df=data.frame(country=c("A","A","A","B","B","B"), food=rep(c("Apples","Pears","Bananas"),2), X2000=c(4,5,6,7,6,8), X2001=c(4,5,6,7,6,8), X2002=c(4,5,6,7,6,8), X2003=c(4,5,6,7,6,8)); I have data in the above form trying to get a plot of each fruit over time year conditioned on country and
2010 Mar 13
2
Indexing a matrix within loops
Hi, I was hoping someone could help me with the following problem. Consider this toy example. For the input dataset there are four individuals (rows "indv.1" through "indv.4"), measured for two different variables (columns "var.1" and "var.2") at two different levels of a factor (column "factor.level"). I want to calculate a matrix that has the
2010 Sep 26
2
Splitting a data frame into several completely separate data frames
Hello again, How do I split a data frame into smaller, completely separate data frames (rather than separate data frames comprising a single "list")? Consider the following data, and my coding attempt: x <- read.table(textConnection("id type number indv.1 bagel 6 indv.2 bagel 1 indv.3 donuts 10 indv.4 donuts 9"), header = TRUE) closeAllConnections() x.split <-
2010 Jun 09
1
Subset columns by prefix
Hello R listserve, I would appreciate someone's help with this problem. Consider the following toy dataset: x <- read.table(textConnection("worldclim.1 worldclim.2 cru.1 cru.2 indv.1 7 8 32 658 indv.2 7 7 39 422"), header = TRUE) How could I create a subset of the data based on the column prefix? For instance, let's say I wanted to subset only the columns with the
2010 Jun 22
1
storing DTMF inputs
Thanks a lot Danny. I have done the part of playing a file by creating a context in my dialplan. Now I am puzzled as i wish to store the DTMF inputs done by the users who is listening to the playback. I found there are ways, but some specific way by which it is not stored in file but conveyed directly to the asterisk server. When the call landed up on the softphone, i pressed keys the
2010 Jul 12
3
Continuing on with a loop when there's a failure
Hi R sages, Here is my latest problem. Consider the following toy example: x <- read.table(textConnection("y1 y2 y3 x1 x2 indv.1 bagels donuts bagels 4 6 indv.2 donuts donuts donuts 5 1 indv.3 donuts donuts donuts 1 10 indv.4 donuts donuts donuts 10 9 indv.5 bagels donuts bagels 0 2 indv.6 bagels donuts bagels 2 9 indv.7 bagels donuts bagels 8 5 indv.8 bagels donuts bagels 4 1 indv.9
2010 Jan 08
2
How to Merge based on Rows
Let's say that I have a bunch of matrices. They look like this (pardon using fruit for examples, my actual data tables are far too enormous): Matrix1 Apples Oranges Pears A 5 6 7 B 5 3 4 C 8 9 10 D 11 13 14 E 15 3 8 F 1 4 5
2007 Aug 26
2
Character position command
This is a very simple question, so I apologize I couldn't find it online: I want to shorten the string 'apples.pears' to 'apples'. string='apples.pears' string1=substr(string,0,x) For x above, I would like to have a command like charAt(string,"."), i.e. the position of the period in the word, but I can't seem to find a charAt command in R. Thank you.
2003 Nov 21
3
what does this mean in R-1.8.1 release notes?
what does this mean in R-1.8.1 release notes? o median() no longer `works' for odd-length factor variables.
2004 Feb 09
5
simple question on picking out some rows of a matrix/data frame
Hi, I have a simple question about matrix/data frame manipulation. I have a data frame that looks a something like this X Y Z 1 0 "apples" -1 -1 "oranges" ... 0 -1 "bananas" and I'd like to pull out all the rows for which X and Y are (un)equal into a submatrix. How can I do that? Many thanks, Roger Levy
2011 May 21
4
[LLVMdev] getCanonicalInductionVariable
Hi I have the followed code for which I am writing a loop pass. int main() { int i = 0; for (i=0; i<20; i++) { printf ("hello world %d\n", i); } return 0; } In the function runOnLoop, I have the following instruction PHINode *indv = NULL; indv = L->getCanonicalInductionVariable(); However, when I check indv is always set to NULL. Since the code has a canonical
2011 May 22
0
[LLVMdev] getCanonicalInductionVariable
Hi, What does your LLVM IR look like. Are you sure the loop hasnt been optimized away? Arushi On Sat, May 21, 2011 at 5:52 PM, Malveeka Tewari <mtewari at eng.ucsd.edu>wrote: > Hi > > I have the followed code for which I am writing a loop pass. > > int main() { > int i = 0; > for (i=0; i<20; i++) { > printf ("hello world %d\n", i); > }
2009 Apr 07
2
xyplot - label one line
Hi All, I have a panel xyplot with 2 lines in each panel. I'd like to label one line only but don't know how to do this. The code below labels both lines. Any ideas how I could change it to show the y-values of only one of the lines? Many thanks! xyplot(apples + bananas ~ year | category, data=fruit, as.table=TRUE, par.strip.text=list(cex=1.2,font="bold"), par.settings =
2006 Feb 23
11
Sessions question
Hi, I''m a little confused about sessions. I have two objects, object "Apple" and object "Banana". These two objects have an N:M relationship. What I am doing is listing All of the Banana objects that are associated with a single Apple, then below that listing all of the Banana objects not associated with that same Apple. The user is then allowed to change the
2010 Apr 16
2
Scanning only specific columns into R from a VERY large file
Hi, I turn to you, the R Sages, once again for help. You've never let me down! (1) Please make the following toy files: x <- read.table(textConnection("var.1 var.2 var.3 var.1000 indv.1 1 5 9 7 indv.210000 2 9 3 8"), header = TRUE) y <- read.table(textConnection("var.3 var.1000"), header = TRUE) write.csv(x, file = "x.csv") write.csv(y, file =
2015 May 15
1
Posix vs. Windows File/Directory Permissions
On Fri, May 15, 2015 at 11:24 AM, Andrey Repin <anrdaemon at yandex.ru> wrote: > Moral of the story: You've compared apples to oranges and claimed that > bananas > are better. > > When you've created a linux user called "Administrator" is had nothing to > do > with AD user "Administrator". > When you changed POSIX access bits on a file it
2010 May 19
2
Reading in and writing out one line at a time
I hope that somebody can help me with this - I think very simple - issue...? I am running a package that only accepts one line at a time, but I would like to run this package on a dataframe of >500 lines. Dataframe "d" is a single column: APPLES PEARS AUBERGINES KUMQUATS I would like to read one line of my dataframe "d", individually into a new frame "f", then
2008 Mar 07
3
Combine two columns
Is there a way to combine two columns within a data frame? Example data: id snp AL1 AL2 1500 30 A B 1510 30 A A 1520 30 A B This is what I would like: indv snp AL1AL2 1500 30 AB 1510 30 AA 1520 30 AB Any help is greatly appreciated. Alysta