similar to: THE EQUIVALENT OF SQL INNER TABLE JOIN IN R

Displaying 20 results from an estimated 10000 matches similar to: "THE EQUIVALENT OF SQL INNER TABLE JOIN IN R"

2009 Apr 27
3
Cannot clean infinite values
Hello all, I have to import numeric data from file but found it contains Infinite values which need to be eliminated. I tried to replace them in this way: data[which(data=="-Inf")] <- -0.3 data[which(data=="+Inf")] <- 0.3 But, somehow, the Infinite values stayed there. Any suggestions? regards, N. -- View this message in context:
2009 Apr 26
1
Unable to re-import a table that was just exported to a file
Hi all, I am saving a program's output to a file to be read by another algorithm. But somehow such a simple operation (the reading) fails. I get: Error in read.table("a_corr_data.txt", sep = ",", col.names = T, row.names = F) : more columns than column names Here is the write statement:
2010 Mar 15
1
inner join sqldf
Hi, I have two dataframes that have some common columns. I would like to join them by the common columns prochi and prescribed_date as there are duplicate prochis but they will be made unique by date. I tried doing an inner join but that just duplicated the columns whereas I would like the information from the test_sql_tsf to fill the NAs in the test_sql_psd common columns. require(sqldf)
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 20
1
generic genotype calling algorithm?
Hi, I have Agilent and Illumina SNP data. That's the only thing I know about the files - there seem to be no version specification in any of them. Is there a generic genotype calling algorithm that I could try to use on these datasets? thanks, N. -- View this message in context: http://www.nabble.com/generic-genotype-calling-algorithm--tp23141124p23141124.html Sent from the R help
2012 Apr 03
5
R equivalent for SQL query
Hi, I have a query which I would like to translate into R, but I do not know how to do it in an easy way. Assume a data frame has columns A, B and C: A B C 1 1 3 1 1 4 1 1 5 1 2 6 1 2 7 1 3 8 The query is as follows: select A, B, count(*) from data.frame group by A, B order by count(*) desc How do I translate this into R statements in such way that the result is a data frame structured as
2010 Jul 20
1
Error using sqldf
Hi, I am running a query using sqldf() [package : sqldf]. The query is:- userid <- 5 taskid <- 5 tab1 <- fn$sqldf("SELECT tobiiEvents.data1, tobiiEvents.data2, events.`timestamp` as tobiiTime FROM tobiiEvents INNER JOIN events ON events.eventid = tobiiEvents.eventid WHERE tobiiEvents.subtype = 'MOUSE' AND tobiiEvents.userid = 5 AND tobiiEvents.taskid = 5 ORDER BY
2010 Oct 12
2
merging and working with BIG data sets. Is sqldf the best way??
Hi everyone, I’m working with some very big datasets (each dataset has 11 million rows and 2 columns). My first step is to merge all my individual data sets together (I have about 20) I’m using the following command from sqldf data1 <- sqldf("select A.*, B.* from A inner join B using(ID)") But it’s taking A VERY VERY LONG TIME to merge just 2 of the datasets
2012 Aug 20
1
function case in sqldf (datas from oracle) with a null value
I use sqldf to join 2 dataframes from 2 distinct databases : a and b come from old sqldf's. sqldf("select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as NEW_QTY" from a inner join b on a.OBJECT=b.OBJECT") R doesn't understand "when null". I tried with "when NA", "when '' ", "when ' ' " but it doesn't
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
2015 Jul 27
2
Error sql en función
Hola: No consigo que la función sqldf () funcione dentro de una función. Alguien puede echarme una mano. En resumen, el problema es que cuando lo ejecuto fuera de una función no tengo ningún problema: ========================== > # install.packages("sqldf") > library(MASS) > library (sqldf) > data(Aids2, package="MASS") > options(digits=3) > table
2010 Jul 22
4
SQL/R
Dear R users, I want to aggregate data in the following way: ### X <- data.frame(u = c("T1","T1","T1","T2"), v=c("a","a","b","a")) X library(sqldf) sqlOut <- sqldf("select count(distinct(v)) from X group by u") sqlOut ### Now I want to get the same result without using SQL. How can I achieve that ?
2015 Jul 27
2
Error sql en función
Hola Carlos: Gracias por responder! Ayer caí en esta página al buscar el problema con google, pero no conseguir entender y implementar lo que sugiere. Sin entender nada, lo que hice fue: ======================== > library(MASS) > library (sqldf) # Per SQL > data(Aids2, package="MASS") > SQL_PROVA = function (XDADES, XWHE) + { + XDADES_SQL = sqldf ("select * from
2010 Mar 22
1
SQL-select using native R methods ?
Hi I have a problem in R that I have been trying to solve but without success. I am trying to join two tables on two variables : an ID and a date (optional) that will be common between the two tables In SQL (and SAS PROC SQL) I am a frequent user of the "select" command and I am used to the following nomenclature : select a.*, b.c, b.y, b.z from table1 a, table2 b where
2007 Sep 07
5
SQL like function?
Hi RUsers, I am wonder if I can search observations whose IDs matches any of the values in another vector, such as in MySQL. While I am learing MySQL for future database management, I appreciate if anyone could give me a hint. Suppose I have one 5*1 vector containing observation IDs and frequencies, and one 3*1 vector containing observation IDs. observation<-c(1,2,3,4,5) ID<-c(1,3,4)
2011 Apr 13
1
Decimals in R/SQL
Hello, When I am writing in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.00000, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.0000. I appreciate any suggestions! Thanks! Example: z <- sqldf ("select ST, SUM(AGEP*PWGTP)*1.000000000/SUM(PWGTP)*1.00000000000000 as wgtage from ss09
2008 Jul 14
3
Data Manipulations and SQL
Greetings, I am new to R and have some background knowledge about SQL. I'd like to know whether there is a way to manipulate the R datasets (or data frames) using SQL statements. For example, I have two data frames and both of them have a column called "id", then I want to join this two data frames into one. In SQL, we can just simply use the join comment. What should we do in R?
2010 Mar 15
1
Aggregate and select mode
Greetings Everyone - I have a data frame "x" that looks like this: v1 v2 1 A 1 B 1 B 2 B 2 W 2 W 3 D 3 D 3 Z What I would like to do is create a new data frame, "y", that has one row for each unique value of v1, and returns the corresponding mode of v2. If I were to run it on the above data frame, it should therefore return: v1 v2 1
2006 Sep 05
3
terms.inner
Question: I am trying to impliment a function in R that we use quite regularly in Splus, and it fails due to a lack of the "terms.inner" function in R. The substitute is? Part question and part soapbox: Why remove terms.inner from R? It's little used, but rather innocuous. Mostly soapbox: I figured it was no big deal, as I originally discovered the use of terms.inner from
2020 Jul 01
2
Inner Loop extraction in LLVM
Hello everyone, Quick question about loop extraction in llvm. I've been using the LoopExtractor pass in llvm/lib/Transforms/IPO/LoopExtractor.cpp to extract top level loops from programs. I'm wondering if extracting inner-most loops is any more complex than using the BlockExtractor pass in llvm/lib/Transforms/IPO/BlockExtractor.cpp and making sure that the basic blocks in the extracted