[R] Ask for help - how to change WHIRR.117.csv to WHIRR_117.csv

2012-09-25 Thread s.s.m. fauzi
Hi, I have a script below. dat <- read.table(file="pt.csv", header=T, sep=",", row.names=1, col.names=1) dat for(which_col in seq_len(ncol(dat))) { subset_data <- dat[,which_col:ncol(dat)] file_name <- sprintf('%s.csv', colnames(dat)[which_col]) write.csv(subset_data, file_name)

Re: [R] Write table with data in other .csv template

2012-09-25 Thread s.s.m. fauzi
Hi Jeff, I got it...Thank you for your help! On Wed, Sep 26, 2012 at 11:53 AM, s.s.m. fauzi wrote: > Hi Jeff, > Do I need to call the .csv template to perform this operation? > > Shukor > > > On Wed, Sep 26, 2012 at 11:50 AM, Jeff Newmiller > wrote: > >> Per

Re: [R] Write table with data in other .csv template

2012-09-25 Thread s.s.m. fauzi
esearch Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks > ...1k > --- > Sent from my phone. Please excuse my brevity. > > "

Re: [R] Write table with data in other .csv template

2012-09-25 Thread s.s.m. fauzi
gt; /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > ------- > Sent from my phone. Please excuse my brevity. > > "s.s.m. fauzi" wrote: > > >Hi, > > > >I have a table with data, as below: &g

[R] Write table with data in other .csv template

2012-09-25 Thread s.s.m. fauzi
Hi, I have a table with data, as below: dput(table): structure(list(Adrian.Cole = c(0L, 0L, 0L, 0L, 0L, 0L), Alison.Wong = c(0L, 0L, 0L, 0L, 0L, 0L), Andrei.Savu = c(0L, 0L, 0L, 0L, 0L, 0L), Bruno.Dumon = c(0L, 0L, 0L, 0L, 0L, 0L), Edward.J..Yoon = c(0L, 0L, 0L, 0L, 0L, 0L), Eugene.Koontz =

[R] chunk row to new table/file

2012-09-17 Thread s.s.m. fauzi
I have big .csv file. I would like to filter that file into a new table. For example, I have .csv file as below: f1 f2 f3 f4 f5 f6 f7 f9 f10 f11 t1 1 0 1 0 1 0 0 0 01 t2 1 0 0 0 0 1 1 1 11 t3 0 0 0 0 0 0 0 0 00 t4 1

[R] How to divide each column with its own value

2012-09-16 Thread s.s.m. fauzi
Hi, I have a matrix as below: mat= [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 What I want to do is, I would like to divide each column with its own value, in order to get value 1. Is there any simple script for that? [[alternative HTML version dele

[R] How to filter information from a big .csv table into a new table

2012-09-16 Thread s.s.m. fauzi
Hi, I have big .csv file. I would like to filter that file into a new table. For example, I have .csv file as below: f1 f2 f3 f4 f5 f6 f7 f9 f10 f11 t1 1 0 1 0 1 0 0 0 01 t2 1 0 0 0 0 1 1 1 11 t3 0 0 0 0 0 0 0 0 00 t4 1 0 0 0

Re: [R] self defined distance matrix in NbClust

2012-09-16 Thread s.s.m. fauzi
Hi, I have big .csv file. I would like to filter that file into a new table. For example, I have .csv file as below: f1 f2 f3 f4 f5 f6 f7 f9 f10 f11 t1 1 0 1 0 1 0 0 0 01 t2 1 0 0 0 0 1 1 1 11 t3 0 0 0 0 0 0 0 0 00 t4 1 0 0 0

Re: [R] Error during matrix multiplication

2012-09-12 Thread s.s.m. fauzi
- > Sent from my phone. Please excuse my brevity. > > "s.s.m. fauzi" wrote: > > >Hi, > >I have two matrix from two different .csv files. > > > >#load .csv files > >a <- as.matrix(read.table("Whirr_127.csv", header=T, sep=

[R] Error during matrix multiplication

2012-09-12 Thread s.s.m. fauzi
Hi, I have two matrix from two different .csv files. #load .csv files a <- as.matrix(read.table("Whirr_127.csv", header=T, sep=",", row.names=1)) b <- as.matrix(read.table("Files_Whirr_127.csv", header=T, sep=",", row.names=1)) a b I managed to do transpose to 'b' without any error. transpose_ta

[R] Read data from .csv file as a matrix and compare the different between two matrix

2012-09-04 Thread s.s.m. fauzi
Hi, I have two table matrix, and I would like to compare the different between two matrix. For example: Matrix 1: A B C A 0 1 0 B 0 0 1 C 0 0 0 Matrix 2: A B C A 0 1 0 B 0 0 0 C 0 0 0 Each column which have value 1, should also return value 1. As in this case/example, the result