Re: [R] Removing rows in a data frame

2015-07-02 Thread Bert Gunter
?precedence -5:10 is (-5):10 -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Thu, Jul 2, 2015 at 10:23 PM, Charles Thuo wrote: > I have a data frame whose rows are 678013 . I would like to remove ro

[R] Removing rows in a data frame

2015-07-02 Thread Charles Thuo
I have a data frame whose rows are 678013 . I would like to remove rows from 30696 to 678013 and then attach a new column with a length of 30595. I tried Y<- X[-30595:678013,] and its not working In addition how do i add a new column Kindly assist. Charles [[alternative HTML version

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Duncan Mackay
Hi I usually avoid global settings as they may change between graphs therefore I use the par.settings in each plot My settings are par.settings = list(fontsize = list(text = 10.5, points = 8), strip.background = list(co

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

2015-07-02 Thread Nordlund, Dan (DSHS/RDA)
Ravi, Take a look at the following link. https://code.google.com/p/r-bc/ I followed the instructions to get a Windows version of the 'nix utility program , bc (a high precision calculator), and the source for an R to bc interface. After installing them, I executed exp(sqrt(bc(163))*4*atan(

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

2015-07-02 Thread Jeff Newmiller
But not 120 bits of pi... just 120 bits of the double precision version of pi. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

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

2015-07-02 Thread Richard M. Heiberger
precedence does matter in this example. the square root was taken of a doubleprecision (53 bit) number. my revision takes the square root of a 120 bit number. > sqrt(mpfr(pi, 120)) 1 'mpfr' number of precision 120 bits [1] 1.7724538509055159927515191031392484397 > mpfr(sqrt(pi), 120) 1 'mpfr'

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

2015-07-02 Thread Richard M. Heiberger
There is a precedence error in your R attempt. You need to convert 163 to 120 bits first, before taking its square root. > exp(sqrt(mpfr(163, 120)) * mpfr(pi, 120)) 1 'mpfr' number of precision 120 bits [1] 262537412640768333.51635812597335712954 ## just the last four characters to the left o

[R] no slot of name "fixef" for this object of class "lmerMod"

2015-07-02 Thread Iker Vaquero Alba
   Hello everyone.    I am trying to re-analyse some data with an R function I last used in 2011. Everything seemed to work fine then, but now, using the same code, it gives me this error:    Error in R.pe(y, group1, group2, returnR = FALSE) :   no slot of name "fixef" for this object of class "

Re: [R] question

2015-07-02 Thread Lida Zeighami
Thank you so much for replying me! for better understanding my problem, I explain my problem more: I have a 682*1 matrix called "met" , the first 5 rows similar below: > rownames(met)[1:5] [1] "glycine_imp" [2] "Nacetylglycine_imp" [3] "sarcosine_imp" [4] "dimethylglycine_imp" [5] "betaine

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Bert Gunter
Let me rephrase my 2nd point: simpleTheme() has a specific list of **arguments** which is nothing like you show. As the Help says, its value is a list of parameter settings that can be used by par.settings. -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Bert Gunter wrote: 1. box.rectangle, etc. are not functions; they are (lists of) parameters that are sublists of the par.settings list. Bert, Thought so ... 2. Read the Help for simpleTheme() -- it has a specific list of parameters which is nothing like what you show.

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Bert Gunter
1. box.rectangle, etc. are not functions; they are (lists of) parameters that are sublists of the par.settings list. 2. Read the Help for simpleTheme() -- it has a specific list of parameters which is nothing like what you show. Cheers, Bert Bert Gunter "Data is not information. Information is

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

2015-07-02 Thread jim holtman
This is the standard FAQ 7.31 and then read in detail the referenced paper. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Thu, Jul 2, 2015 at 2:02 PM, Aditya Singh via R-help < r-help@r-project.org> wrot

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, Rich Shepard wrote: ... and invoking R within emacs ... Trying a different approach: bwplot(quant ~ param, data = b, main = 'Stream B Constituents', ylab = 'Concentration (mg/L)', xlab = 'Constituent', par.settings = simpleTheme(box.rectangle(col = 'black'), box.umbrel

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] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, David Winsemius wrote: My .Rprofile has this (among other items): ... David, My attempts at adding lattice.options to .Rprofile fail. In that file is lattice.options(trellis.par.set(list( box.umbrella=list(col="black"), box.rectangle=l

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

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

2015-07-02 Thread Jeff Newmiller
I don't know much about Rmpfr, but it doesn't look like your "pi" or "sqrt" or "exp" are being handled by that package, so I am not really seeing why your result should be more accurate when you have loaded that package. ---

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

2015-07-02 Thread Boris Steipe
Just a wild guess, but did you check exactly which operations are actually done to high precision? Obviously you will need high-resolution representations of pi and e to get an improved result. B. On Jul 2, 2015, at 10:28 AM, Ravi Varadhan wrote: > Hi, > > Ramanujan supposedly discovered t

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread David Winsemius
On Jul 2, 2015, at 9:57 AM, Rich Shepard wrote: > On Thu, 2 Jul 2015, David Winsemius wrote: > >> The lead-in to section 7.2 mentions `trellis.par.get`, but in order to >> change anything you need to use `trellis.par.set` as was illustrated in >> the pages leading up to that section: > > David

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Rich Shepard
On Thu, 2 Jul 2015, David Winsemius wrote: The lead-in to section 7.2 mentions `trellis.par.get`, but in order to change anything you need to use `trellis.par.set` as was illustrated in the pages leading up to that section: David, I saw `trellis.par.set` but did not know how to use that in

Re: [R] Extracting data from a file containing data

2015-07-02 Thread Peter Tuju
Dear Jim,Thank you very much indeed. Its a great job you have done and I really appreciate.Thank you so much.  _ Peter  E. Tuju Dar es Salaam T A N Z A N I A -- From: jim holtman To: Peter Tuju Cc: "r-help@r-project.org" Sent: Thursday, July 2, 2015 3:4

Re: [R] as.numeric looses precision

2015-07-02 Thread Calin Uioreanu
Hello, There's a difference between the displayed value and the internally stored. You could use options(digits=10), but this is a global option, and will affect all future numerical output. default value is 7 > p <- "1087.003489" > as.numeric(p, digits=6) [1] 1087.003 > options(digits=10) # set

[R] checkConv problems in R

2015-07-02 Thread Saudi Sadiq
Hi All, I hope you will give me a hand with the checkConv problems. have two datasets, vowels and qaaf, and both have many columns. I am interested in these 8 columns clarified as follows: 1. convergence: DV (whether participants succeeded to use CA (Cairo Arabic) instead of MA (Minia Ar

Re: [R] checkConv and as.data.frame.default problems in R

2015-07-02 Thread Saudi Sadiq
Hi Jon, Thanks for your reply. I will try again, after correcting mistakes. Then, if the model does not converge, I will come back to you with datasets attached. Best On 1 July 2015 at 21:01, John Fox wrote: > Dear Saudi Sadiq, > > If you want answers to most of your questions, you'll likely hav

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

2015-07-02 Thread Ravi Varadhan
Hi, Ramanujan supposedly discovered that the number, 163, has this interesting property that exp(sqrt(163)*pi), which is obviously a transcendental number, is real close to an integer (close to 10^(-12)). If I compute this using the Wolfram alpha engine, I get: 262537412640768743.25

Re: [R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread David Winsemius
On Jul 2, 2015, at 7:46 AM, Rich Shepard wrote: > Lattice's bwplot() displays and prints (using pdf()) the box.rectangle and > box.umbrella in a pale blue that is a pale gray on b&w laser printer output. > I would like to set default options so the box and whiskers are displayed > and printed in

Re: [R] Fread: add one to skip string identifier

2015-07-02 Thread Trevor Davies
Hi Jim, Thanks,Jim. I couldn't get fread to work either for this. I ended up with this: txt<- readLines('test_fread.dat'); data.frame1 <- read.table(text=txt, sep='', header=FALSE, skip=grep('*END*', txt)) BTW, i use that Map Rose function you wrote a few years back quite often. Thanks for the

Re: [R] as.numeric looses precision

2015-07-02 Thread MacQueen, Don
Although Kehl and Petr have already answered the question, I would suggest this as the simplest way to understand what is going on: > p <- "1087.003489" > print( as.numeric(p) , digits=16) [1] 1087.003489 When R prints numbers, it follows various rules regarding how many decimal places to display

[R] Lattice: set col = "black" for box.rectangle and box.umbrella

2015-07-02 Thread Rich Shepard
Lattice's bwplot() displays and prints (using pdf()) the box.rectangle and box.umbrella in a pale blue that is a pale gray on b&w laser printer output. I would like to set default options so the box and whiskers are displayed and printed in black by modifying ~/.Rprofile by adding a .First() fun

Re: [R] as.numeric looses precision

2015-07-02 Thread Sarah Goslee
Hi Roger, You're mixing up storage and display: p <- "1087.003489" p <- as.numeric(p) > p [1] 1087.003 # the default value for digits = 7, which can be changed with option() > print(p, digits=4) [1] 1087 > print(p, digits=10) [1] 1087.003489 But note also: > print(p, digits=20) [1] 1087.003488

Re: [R] as.numeric looses precision

2015-07-02 Thread PIKAL Petr
Hi As already mentioned it is a matter of printing result on your console. > p <- "1087.003489" > as.numeric(p, digits=6) [1] 1087.003 > options(digits=20) > as.numeric(p) [1] 1087.003488999 The other problem is that when using PC you run into FAQ 7.31 decimal issue. "1087.003489" number ca

Re: [R] as.numeric looses precision

2015-07-02 Thread Kehl Dániel
Hi Roger, I think it does! Try multiplying with 100 or similar. It is just a matter of displaying your result. best d Feladó: R-help [r-help-boun...@r-project.org] ; meghatalmazó: Bos, Roger [roger@rothschild.com] Küldve: 2015. július 2. 15:54 To

[R] as.numeric looses precision

2015-07-02 Thread Bos, Roger
I have a string that contains a number and when I convert it to a number I loose precision and I would like to know if there is a way to avoid that. Here is my example: p <- "1087.003489" as.numeric(p, digits=6) R gives me 1087.003: > p <- "1087.003489" > as.numeric(p, digits=6) [1] 1087.003

Re: [R] checkConv and as.data.frame.default problems in R

2015-07-02 Thread John Fox
Dear Saudi Sadiq, On Thu, 2 Jul 2015 11:58:38 +0100 Saudi Sadiq wrote: > Hi Jon, > Thanks for your reply. I will try again, after correcting mistakes. Then, > if the model does not converge, I will come back to you with datasets > attached. To be clear, you might have more luck getting an answe

Re: [R] package forecast is not working properly

2015-07-02 Thread Uwe Ligges
On 01.07.2015 14:51, Magda Joana Silva wrote: Hello all, I just installed "forecast" package but I have the following error when I try to load the library: library("forecast") Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’:

Re: [R] package forecast is not working properly

2015-07-02 Thread David Winsemius
This has been reported once on rhelp and once on StackOverflow and both times the advice to update to R 3.2.1 was effective in removing the difficulty. (You did get a warning.) R 3.2.1 changed the number of arguments to nchar and this was announced in the NEWS. -- David. On Jul 1, 2015, at