similar to: function in R that's equivalent to SQL's "IN"

Displaying 20 results from an estimated 3000 matches similar to: "function in R that's equivalent to SQL's "IN""

2010 Jun 09
2
Change the name of one column ONLY
Hi all, I have a very simple problem that I cannot seem to find the answer to. Consider the following toy dataset: x <- read.table(textConnection("V1 apples bananas cherries indv.1 7 8 4 3 indv.2 7 7 4 9"), header = TRUE) How would I change the column name of ONLY the first column, not the others? Surely I should not have to re-specify the names of ALL the columns -- e.g.,
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
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
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 :
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 Feb 03
0
Select just numeric values from rows
Terry Any good? list <-"A B C N1 N2 N3 N4 N5 N6 N7 N8 N9 N10 Apples Bananas Peaches 1 2 3 4 5 6 7 8 9 10 Oranges Kumquats Plums 1 1 3 5 5 5 7 6 6 12 Pears Kiwis Grapes 2 4 6 8 5 6 7 6 9 1" d = read.table(textConnection(list), header=TRUE) Nrowsums = apply(d[,sapply(d,is.numeric)],1,sum) HTH Pete -- View this message in context:
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.
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
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.
2009 Feb 19
2
counting strings in a column
Dear All, I have a query : what is the command to count number of repeated words in a column. for ex: a = oranges oranges apples apples grape oranges apple pine the result should be oranges 3 apples 3 grape 1 pine 1 is there an easy way for this. Thanks, Nataraju GM R & D Bangalore -- "No relationship is Static .. You either Step up or Step down" [[alternative HTML
2008 Mar 07
9
question about WINEPREFIX
I wanted to ask to the wine experts something about WINEPREFIX or the crossover bottles... how does the concept of "bottles" compares/differs with the concept of application virtualization (http://en.wikipedia.org/wiki/Application_Virtualization) used by VMware's Thinstall (http://www.thinstall.com/products/virtualization_suite.php) (aside for the .exe container*) and
2019 Jul 18
2
ubuntu equivalent of ctrl-a on windows
Hi All: I'm using an old version of Ubuntu, 14.04, and I can't figure out a keyboard sequence that "selects all" analogously to what ctrl-a does on windows ? If anyone can be bothered running below and see if they have a way to select all four fruits at once, it's appreciated. I've spent quite a bit of time searching the net, going on AskUbuntu etc but no luck. Thanks.
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
2007 Jan 03
1
R and threading
Hi, I am considering using R to integrate with a Java application. However, before deciding upon R I need to understand if R is capable of dealing with multiple requests simulataneously. Is a single instance of R capable of dealing with multiple simulataneous requests or does a new instance of R have to be started for each request? I have read Luke Tierney's 2001 notes on threading at
2004 Nov 11
5
expressions and paste
I have written a function to plot data which will be used for various different chemistries. A simplified version is: plot_data <- function(risk,levels,chem,sd2,measure){ plot(risk, levels,main=paste ("per", sd2, measure, "\n in usual", chem)) } The problem is with the title. This works fine if the variable "chem" is just text, but if it is an expression then
2010 May 18
2
[LLVMdev] Possible memory leak in LLVM 2.5
Hi, I'm current using LLVM 2.5 to JIT code in a event driven language running on a game engine. Haven't updated to 2.7 yet, but I do intend to. When checking for memory leaks I found that each time I was calling EE->runFunction after creating a stub function to execute an event, all the pass information was being repeatedly added to PMDataManager. I have changed addAnalysisImplsPair
2000 Jun 16
3
login reporting (utmp?) problem on Linux
I have recently compiled and installed openssh-2.1.1p1 on a linux box. The login reporting does not seem to work properly. When logging into the box via ssh (protocol 1) utmp shows the user logged in and the tty properly, but the field for the login date/time and the field for originating host contain all NULLs. Is anyone else seeing this same behavior, or have I just done something really
2009 May 19
2
create string of comma-separated content of vector
Hi, how do I create a string of the comma-separated content of a vector? I've got the vector i with several numeric values as content: >str(i) num 99 and want to create a SQL statement to look like the following where the part '(2, 4, 6, 7)' should be the content of the vector i: select * from [biomass_data$] where site_no in (2, 4, 6, 7) Here my approach (which doesn't
2018 Aug 07
2
id <username> - doesnt list all groups
Hello, my enviroment: All Servers are Ubuntun 16.04-18.04 SAMBA AD DC Server and several SAMABA DOMAIN MEMBER (connected via WINBIND). In ADDC I've created a group "restrictaccess" and added some users. Now when im typing "id <username>" on a Domain Member, for some users the group "restrictaccess" are listed for some not! For example: ON DC: #
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