[R] read.csv help

2011-07-19 Thread psombe
Hi, 
I'm a new R user and I'm having trouble with the read.csv command. It
somehow treats the first column as a row name field even though it's not a
row name. there are no missing columns/entries and i'm not sure how to
resolve this. 

the format of my data is 

A, B, C, D,..(3984 columns)
12, 13, 41,..(all numeric)

it either treats column A as rownames or if I explicitly disable row names
with row.names = NULL field it right shifts all the columns like

rowno. A   B   C Last column 
1  12  13   41    NA

Srinivas 

--
View this message in context: 
http://r.789695.n4.nabble.com/read-csv-help-tp3677454p3677454.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] read.csv help

2011-07-19 Thread psombe
Well yeah it works fine for small data but when i tried the exact same
command with a large data set (abt 167 rows and 4000 columns) it gave me a
different data frame.
 either i get the first column as row names and so when i put data[1,1] i
get the the first row second column data (from the original data) as the
first row became row names.
or 
if i explicitly put row.names = NULL i get my columns shifted.

this is how the data should look
 tdata[1,1:3]
   timestamp system.system.nfs_ops system.system.cifs_ops
1 1299376803   1104233  0
 

and this is how i'm able to load the data

   row.names timestamp system.system.nfs_ops system.system.cifs_ops
1 1299376803   1104233 0  0

notice the shift in the first column
i hope this makes my problem clearer

--
View this message in context: 
http://r.789695.n4.nabble.com/read-csv-help-tp3677454p3677586.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Support Counting

2011-04-05 Thread psombe
well im using the arules package and i'm trying to use the support command.
my data is read form a file using the read.transactions command and a line
of data looks something like this. there are aboutt 88000 rows and 16000
different items
 inspect(dset[3])
  items
1 {33, 
34, 
35} 
 inspect(dset[1])
  items
1 {0, 1,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2,  20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 3, 4,5, 6, 7,  8,  9}  

So in order to use support i have to make an object of class itemsets and
im kind of struggling with the new command.
I made an object of class itemsets by first creating a presence/absence
matrix and with something like 16000 items this is really sort of tedious. I
wonder if there is a better way.

//Currently im doing this

avec = array(dim=400) //dim is till the max number of the item im concerned
with
avec[1:400] = 0
avec[27] = 1
avec[63] = 1 //and do on for all the items i want

amat = matrix(data = avec,ncol = 400)
aset = as(amat,transactions) //coercing the matrix as a transactions class

then say my data is dat i can use

support(aset,dat)
[1] 0.001406470


There has to be a better way
Thanks once again

--
View this message in context: 
http://r.789695.n4.nabble.com/Support-Counting-tp3424730p3428062.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Support Counting

2011-04-04 Thread psombe
Hi,
   I'm new to R and trying to some simple analysis. I have a data set with
about 88000 transactions and i want to perform a simple support count
analysis of an itemset which is say not a complete transaction but a subset
of a transaction.
say

{A,B,D} is a transaction and i want to find support of {A,B} even though it
never occurs as only A,B in the entire set


 To this i needed to create a new itemsets class and then use the support
function but somehow the answers never seem to tally.

Thanks in advance
Srinivas

--
View this message in context: 
http://r.789695.n4.nabble.com/Support-Counting-tp3424730p3424730.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.