Re: [R] : Ramanujan and the accuracy of floating point computations - using Rmpfr in R

2015-07-02 Thread Aditya Singh via R-help
Ravi I am a chemical engineer by training. Is there not something like law of corresponding states in numerical analysis? Aditya -- On Thu 2 Jul, 2015 7:28 AM PDT Ravi Varadhan wrote: >Hi, > >Ramanujan supposedly discovered that the number, 163, has this interest

Re: [R] Ramanujan and the accuracy of floating point computations - using Rmpfr in R

2015-07-02 Thread Aditya Singh via R-help
Ravi 1. You may want to check the sqrt too. 2. Why not take log and try? Aditya -- On Thu 2 Jul, 2015 10:18 AM PDT Boris Steipe wrote: >Just a wild guess, but did you check exactly which operations are actually >done to high precision? Obviously you will need hi

[R] Help sought with 1. converting factor to numeric; 2. creating new dataframe

2014-12-16 Thread Aditya Singh via R-help
Dear R-experts, I am relatively new to R. Please help me in converting a dataframe into a numeric and then creating a new dataframe. R-code attached: my_xtrain=read.table("./train/X_train.txt") my_xtest=read.table("./test/X_test.txt") my_merge_data=merge(my_xtrain,my_xtest,all=TRUE) ### my

[R] How do I extract single entries from a factor?

2014-11-21 Thread Aditya Singh
N.b. There's also a missing "}" and totally messed up formatting :-( B. On Nov 21, 2014, at 1:19 PM, Aditya Singh wrote: > 1 my_min= > min(outcome_data[which(outcome_data$State==my_state),11],na.rm=TRUE) > 2 print(my_min) > 3 jkr=0 > 4 if (jkr<= 4706) {jkr

[R] Wondering why I get a NULL output for this if condition!

2014-11-21 Thread Aditya Singh
1 my_min= min(outcome_data[which(outcome_data$State==my_state),11],na.rm=TRUE) 2 print(my_min) 3 jkr=0 4 if (jkr<= 4706) {jkr=jkr+1 5 if (identical(outcome_data[jkr,11],my_min) && identical(outcome_data[jkr,7],my_state)) { 6 print((outcome_data[jkr,2])) 7 break 8 } Dear Experts, My comp

[R] Function returns NULL on running this code in latest version of R!

2014-11-20 Thread Aditya Singh
Any help on this issue will be greatly appreciated. Spent days sitting alone in a remote corner of the world--> Patiala, Punjab, India.. trying to do this! --- setwd("C:/Documents and Sett

Re: [R] R 3.1.2 (x64) Programming Assignment 1: Air Pollution(corr) do not understand the task

2014-11-18 Thread Aditya Singh
Eva and Professor Peng, I spent many hours on Programming Assignment 1, however I was unable to get it right. I found it most useful and think others should work at it too! Please do send me your work now that the deadline is over. Or you could tell me your Github account so that I could fork i

[R] Error: (list) object cannot be coerced to type double; on running the following code in R ver 3.1.2

2014-11-11 Thread Aditya Singh
setwd("C:/Documents and Settings/Administrator/Desktop/Coursera/specdata/specdata")temp=list.files(pattern="*.csv")myfiles=lapply(temp,read.delim)summk=0nummk=0for (i in 1:10) {  vb=data.frame(myfiles[i])  vbm=as.double(vb)  summk=sum(vbm[,2])  nummk=length(vbm[,2]) - sum(is.na(vbm[,2]))} Aditya

[R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-10 Thread Aditya Singh
Hi, I have 2 queries: 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric? As a help to others, I figured out to use setwd("C:/") to set working directory! Aditya [[alternative HTML version