Re: [R] fread transforms numbers

2017-03-22 Thread Jeff Newmiller
A) You have been given a workaround (colClasses). B) 3.2.3 is not the current version of R. Support for older versions may vary from CRAN mirror to mirror. You could try another mirror. C) Technically, "Linux" is not an operating system, it is a kernel. Debian and Fedora are examples of operat

Re: [R] fread transforms numbers

2017-03-22 Thread Santosh
Dear Rxperts.. I am using R version 3.2.3 on Linux.. it says bit64 is not available for R version 3.2.3.. Thanks and your assistance much appreciated! Best regards, Santosh On Wed, Mar 22, 2017 at 7:50 PM, Santosh wrote: > Thanks so much for your suggestions! Will try them out! > > Santosh > >

Re: [R] fread transforms numbers

2017-03-22 Thread Santosh
Thanks so much for your suggestions! Will try them out! Santosh On Wed, Mar 22, 2017 at 12:17 PM, Matt Dowle wrote: > Thanks Bill for cc. > > Santosh, > > I'm almost certain you don't have package bit64 installed. When you do it > works fine : > > > remove.packages("bit64") > > data.table::fre

Re: [R] Correlation code not working but not sure why

2017-03-22 Thread John C Frain
I can't see anything wrong with your code. You should read the posting guide and produce a minimal example showing the problem and any other details requested there. If I take just the small sample of data that you have provided and run a slightly adapted version of your code data = read.table("q

Re: [R] r question

2017-03-22 Thread Rui Barradas
Hello, There's a paenthesis missing in > relativerisk<- matrix(log(c(1,1,2,2),ncol=4,byrow = TRUE) + beta_true<-relativerisk Error: unexpected symbol in: "relativerisk<- matrix(log(c(1,1,2,2),ncol=4,byrow = TRUE) beta_true" The correct instruction would be relativerisk<- matrix(log(c(1,1,2,2))

Re: [R] fread transforms numbers

2017-03-22 Thread Matt Dowle
Thanks Bill for cc. Santosh, I'm almost certain you don't have package bit64 installed. When you do it works fine : > remove.packages("bit64") > data.table::fread("9876543210\n") V1 1: 4.879661e-314 > install.packages("bit64") > data.table::fread("9876543210\n") V1 1: 9

[R] Correlation code not working but not sure why

2017-03-22 Thread Ashley Patton via R-help
Good afternoon, I was wondering if someone could help me with what I am sure is likely to be a really simple problem but I cannot work out what I have done wrong. I have tried searching the forums/Google etc but can't find anything quite like the code I am using other than things that do not di

Re: [R] fread transforms numbers

2017-03-22 Thread William Dunlap via R-help
Here is a way to reproduce the problem: > data.table::fread("9876543210\n") # number bigger than 2^31-1 V1 1: 4.879661e-314 and your work-around does fix things up > data.table::fread("9876543210\n", colClasses="numeric") V1 1: 9876543210 Bill Dunlap TIBCO Soft

Re: [R] fread transforms numbers

2017-03-22 Thread Jeff Newmiller
You failed to provide a reproducible example, and you posted HTML so the quality of any answer will be limited by the quality of your question. My stab at your problem is that you should read ?fread, and in particular should try using the colClasses argument. -- Sent from my phone. Please excus

[R] fread transforms numbers

2017-03-22 Thread Santosh
Hi I have been using "fread" utility of "data.table" packge .. on a dataset of about 20 million rows. It's a fantastic package to read datasets. Thank you, Matt D. However, I am faced with a peculiar instance of certain numbers in a column being transformed. In the dataset, a column has values

Re: [R] string pattern matching

2017-03-22 Thread William Dunlap via R-help
You did not describe the goal of your pattern matching. Were you trying to match any string that could be interpreted as an R expression containing X1 and X3 as additive terms? If so, you could turn the string into a one-sided formula and use the terms() function. E.g., f <- function(string) {

Re: [R] Issue with subset in glm

2017-03-22 Thread Bert Gunter
The subset argument is evaluated in "data" first, then in the caller's environment, etc. So: 1) In your first example, stype is a *vector*, and the subset expression is identically TRUE, hence is equivalent to making the call without the subset argument. 2) The second call fits the subset with st

Re: [R] argument to 'which' is not logical

2017-03-22 Thread Jeff Newmiller
The `c` function is extremely common. You CAN redefine this object as a numeric variable if you want but I strongly recommend against it. I don't recognize the function you are using to create cvfits, but it looks like the coef method for that object is not returning a numeric vector, so your

[R] r question

2017-03-22 Thread 謝孟珂
Hi ,I have some question about simulate, I don't know how to paste question to this website,so I paste below. I use genoud to find the maximum likelihood value, but when I use numcut=3 ,it will get error message,like this " coxph.wtest(fit$var[nabeta, nabeta], temp, control$toler.chol) : NA/NaN/Inf

[R] argument to 'which' is not logical

2017-03-22 Thread Allan Tanaka
I'm trying to run the code: inds<-which(c != 0 ), but it gave me error: Error in base::which(x, arr.ind, useNames, ...) :   argument to 'which' is not logical Here is code: alphas <- seq(0, 1, by=.002)mses <- numeric(501)mins <- numeric(501)maxes <- numeric(501)for(i in 1:501){  cvfits <- cv.glmn

Re: [R] string pattern matching

2017-03-22 Thread Joe Ceradini
Wow. Thanks to everyone (Jim, Ng Bo Lin, Bert, David, and Ulrik) for all the quick and helpful responses. They have given me a better understanding of regular expressions, and certainly answered my question. Joe On Wed, Mar 22, 2017 at 12:22 AM, Ulrik Stervbo wrote: > Hi Joe, > > you could also

Re: [R] Data and Variables from Tables

2017-03-22 Thread Shawn Way
I implemented the second as well. It was much easier to create a function to automate this as well as assign the results to a single data.frame Shawn Way, PE -Original Message- From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Sent: Tuesday, March 21, 2017 5:40 PM To: r-help@r-pr

Re: [R] Using betareg package to fit beta mixture with given initial parameters

2017-03-22 Thread Santiago Bueno
Tree dbh haut Btot 1 35.00 18.90 0.357 2 25.00 16.60 0.214 3 23.00 19.50 0.173 4 13.50 15.60 0.060 5 20.00 18.80 0.134 6 23.00 17.40 0.137 7 29.00 19.90 0.428 8 17.60 18.20 0.100 9 31.00 25.30 0.514 10 26.00 23.50 0.273 11 13.00 13.00 0.031 12 32.00 20.70 0.356 13 28.00 28.50 0.349 14 15.00 18.20 0

[R] Extracting Monthly timeseries data for a defined period using ncdf4 package

2017-03-22 Thread കുഞ്ഞായി kunjaai
Dear All, I am trying to extract a time series dataset from a netCDF file. I want to extract data for the time period 1971-1 to 1990-12-31 only. time axis units is 'days since 1850-1-1' For one or two files I can use "count" argument, but I have more than 100 such files and its time units a

Re: [R] Using betareg package to fit beta mixture with given initial parameters

2017-03-22 Thread Achim Zeileis
On Wed, 22 Mar 2017, Michael Dayan wrote: The method of setting the initial values given lambda, alpha1, etc. should not depend on the exact values of lambda, alpha1, etc. in my situation, i.e. it does not depend on my data. Presently, flexmix() that betamix() is built on cannot take the param

Re: [R] A request

2017-03-22 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of RAHUL > 14BCE0064 > Sent: Monday, March 20, 2017 12:24 PM > To: r-help@r-project.org > Subject: [R] A request > > Hello there!! > > Could somebody please go through the question ( > http://stats.stack