[R] strsplit with invalid regular expression

2012-11-08 Thread Bharat Warule
Hi all,

 diff_operator - \\(
 strsplit(cond, diff_operator)
[[1]]
[1] andsin log_angle_1_4)

 diff_operator - \\sin(
 strsplit(cond, diff_operator)
Error in strsplit(cond, diff_operator) : 
  invalid regular expression '\sin(', reason 'Missing ')''

When I am going to split with ( it’s working fine but when i want use
sin( this is not working.
I understand that, I am missing something can anybody please point me.
Thanks for your help.

Thanks,
Bharat



-
Bharat Warule 
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/strsplit-with-invalid-regular-expression-tp4648857.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] convert ff_vector object into as.Date

2012-10-29 Thread Bharat Warule
hello R Users!

Can anybody please help me how to convert ff_vector object into as.Date 
then I have apply  ffwhich condition?

class(y_in_ffdf$dateval)
[1] ff_vector ff   

y_in_ffdf$dateval - as.Date(y_in_ffdf$dateval)
Error in as.Date.default(y_in_ffdf$dateval) : 
  do not know how to convert 'y_in_ffdf$dateval' to class Date
  
y_in_ffdf - y_in_ffdf[ffwhich(y_in_ffdf$dateval = max_span_start_date),]

Thanks,
BHarat



-
Bharat Warule 
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/convert-ff-vector-object-into-as-Date-tp4647753.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] Delete first row

2012-10-26 Thread Bharat Warule
Hi,

I have to delete first row from my csv file but I don’t want to read total
data in to R memory (size is around 10GB). Actually, I want to use LAF
package but which read data without header.

Can anybody help me to resolve this problem? 




-
Bharat Warule 
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Delete-first-row-tp4647518.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] help with read.table.ffdf parameters

2012-10-26 Thread Bharat Warule
Thanks MCOM,

This is really helpful for me.



-
Bharat Warule 
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/help-with-read-table-ffdf-parameters-tp3223805p4647527.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] Split CSV as per file size

2012-08-10 Thread Bharat Warule

check this! if it helps!

read_data - read.csv(DataMatrix)
length - dim(read_data)[1]
no_of_files -  10 ##user define
file_no_itr - length/no_of_files

for(i in 1:no_of_files){
e_l - i*file_no_itr
s_l - 1 + (i-1)* file_no_itr
if(i==no_of_files){ e_l - length}
read_data_new - read_data[s_l:e_l,]
newname - paste(read_data,i,sep=_)
assign(read_data_new,newname)
### write ur output data code 
}



-
Bharat Warule 
Cypress Analytica ,
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Split-CSV-as-per-file-size-tp4639880p4639883.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] Warning message with read.csv.sql

2012-07-12 Thread Bharat Warule
Hello,

I am using read.csv.sql first time for reading the large data file.If I am
ran this code that showns warning “closing unused connection”.

Is it I am missing any argument from my command or how to comeout from this
warning?.

R code:-

Library(sqldf)

ip_dir_path - “D:/BharatWarule/big_data_July”

inFile_sql - file.path(ip_dir_path, cypress_modeldev_account_info.csv)
input_abt - read.csv.sql(inFile_sql,sql = s)
Warning message:
closing unused connection 3
(D:/BharatWarule/big_data_July/cypress_modeldev_account_info.csv) 


Thanks,
Bharat  


-
Bharat Warule 
Cypress Analytica ,
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Warning-message-with-read-csv-sql-tp4636285.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] Rare event in logistic regression

2012-06-07 Thread Bharat Warule
Hello,

I am working with logistic analysis in which event rate is 0.005% with large
requirds.   
Is there is any R package which handle rare event in logistic regression.
Please let me know?

Thanks for your help.

Thanks,
Bharat 


-
Bharat Warule 
Cypress Analytica ,
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Rare-event-in-logistic-regression-tp4632656.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] Merging multiple data sets

2012-05-16 Thread Bharat Warule
Hello R user,

I have four data sets in dir D:/Bharat Warule/Rdata_file which are
output_data_prod_1.rda, output_data_prod_2.rda, output_data_prod_3.rda,
output_data_prod_4.rda.
Each data set is huge size like number of rows 343297 and columns are near
to 50. 

For example:

x1 - data.frame(x11=c(1,2,3,4,5),x112=c(10,10,10,10,10))
x2 - data.frame(x11=c(1,2,3,4,5),x122=c(20,20,20,20,20))
x3 - data.frame(x11=c(1,2,3,4,5),x132=c(30,30,30,30,30))
x4 - data.frame(x11=c(1,2,3,4,5),x142=c(40,40,40,40,40))
x5 - data.frame(x11=c(1,2,3,4,5),x152=c(50,50,50,50,50))

for(i in 1:5){
name - paste('x',i,sep='')
name1 - paste(name,rda,sep='.')   
save(name, file = name1)
}


I want merge this data sets into one data set but I don’t know where I am
going wrong?

Please help me. Thanks for your help.  

subsetname -  x1
file_no-   4
output_data_prod-   data.frame()

for(n in 1:file_no){
 myfile- gsub(( ), , paste(subsetname , _, n,.rda))
 temp_data - load(file = myfile)
 data_22   - get(temp_data)

 if(dim(output_data_prod)[1]==0){output_data_prod - data_22  
  }else{
  output_data_prod - merge(inData1 = output_data_prod,
inData2 = data_22 ,type = inner, all=FALSE ,
by =c(x11))}

}


-
Bharat Warule 
Cypress Analytica ,
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Merging-multiple-data-sets-tp4630244.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] “Within is working or not in loop”

2012-04-10 Thread Bharat Warule
“Within is working or not in loop”
for(j in 1:10){
card_bal   - as.numeric(segment_cuts$card_bal[[j]])
insurance_bal  - as.numeric(segment_cuts$insurance_bal[[j]])
data$segment_rank - 
 within(data,segment_rank[ data$Total_Balance  = total_bal 
data$Insurance_Balance  = insurance_bal] - “class1” )}

“I am not sure about why within is working inside for loop or not.
I did not get any error but when ran this for j=1 then it will create
duplicate columns in data.


-
Bharat Warule 
Cypress Analytica ,
Pune
--
View this message in context: 
http://r.789695.n4.nabble.com/Within-is-working-or-not-in-loop-tp4544965p4544965.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.