If I assign the file input to y_data and change you sqldf to
> z <- sqldf("select * from x_data left join y_data using
(item_code)"); z
I can replicate your result. Even after changing the types of the two
item_code fields to match I still get the same result and when I see
to what degre
Sorry! It is the end of the day for me.
So
dput(x)
structure(list(prochi = c("CAO713", "CAO713", "CAO713",
"CAO713", "CAO713", "CAO713", "CAO713", "CAO713",
"CAO713", "CAO713"), prescribed_date = c("22/06/2001",
"28/04/2000", "10/04/2000", "03/07/2000", "
Yes, its not clear what data was used. Please provide a single email
that contains code that can be copied from R and pasted into another
session that will reproduce the problem.
x_data <- ...dput output goes here...
y_data <- dput output goes here ...
library(sqldf)
... rest of code ...
or else
Sorry! It is the end of the day for me.
So
dput(x)
structure(list(prochi = c("CAO713", "CAO713", "CAO713",
"CAO713", "CAO713", "CAO713", "CAO713", "CAO713",
"CAO713", "CAO713"), prescribed_date = c("22/06/2001",
"28/04/2000", "10/04/2000", "03/07/200
You have now given two different assignments to x_data and none to
y_data:
The str( from the file access offering:
> str(x_data)
'data.frame': 2848 obs. of 5 variables:
$ item_code : int 100 110 150 160 161 164 200 210 212 220 ...
$ name: chr "NEONACLEX K" "NEONACLEX"
The y_data file has over 9000 rows in it so I thought it would be more
practical to give you the file to download
--
View this message in context:
http://n4.nabble.com/sqldf-not-joining-all-the-fields-tp1590786p1590833.html
Sent from the R help mailing list archive at Nabble.com.
__
What about y_data?
On Fri, Mar 12, 2010 at 12:14 PM, Newbie19_02 wrote:
>
> dput(x_data)
>
> structure(list(prochi = c("CAO713", "CAO713", "CAO713",
> "CAO713", "CAO713", "CAO713", "CAO713", "CAO713",
> "CAO713", "CAO713"), prescribed_date = c("22/06/2001"
Please provide code that I can just copy from your post and paste into
my session. Either provide dput output as requested or provide the
files on the internet together with code that reads them off the
internet.
On Fri, Mar 12, 2010 at 12:06 PM, Newbie19_02 wrote:
>
> http://n4.nabble.com/file
y_data <- read.table("feb_267_presc_items_tsf.txt", header = TRUE, sep = "|",
quote = "\"'",
dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA,
nrows = 3864284,
skip = 0, check.names = TRUE,fill=TRUE,
strip.white = TRUE, blank.lines.skip = TRU
dput(x_data)
structure(list(prochi = c("CAO713", "CAO713", "CAO713",
"CAO713", "CAO713", "CAO713", "CAO713", "CAO713",
"CAO713", "CAO713"), prescribed_date = c("22/06/2001",
"28/04/2000", "10/04/2000", "03/07/2000", "09/01/2001", "16/10/2001",
"16/08/20
http://n4.nabble.com/file/n1590804/feb09_267_presc_items_tsf.txt
feb09_267_presc_items_tsf.txt
is the total file for y so if I use the command line with the total data for
y then I get the output specified in z
Thanks,
Natalie
--
View this message in context:
http://n4.nabble.com/sqldf-not-jo
Can you show the output of dput(x_data) and dput(y_data).
On Fri, Mar 12, 2010 at 11:56 AM, Newbie19_02 wrote:
>
> Dear R users,
>
> I have two data frames that were read from text files as follows:
>
> x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'",
> dec =
Dear R users,
I have two data frames that were read from text files as follows:
x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'",
dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA,
nrows = 3864284,
skip = 0, check.names = TRUE,fill=TRUE
13 matches
Mail list logo