Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
Dear Ivan, Thanks a lot.! Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Ivan Krylov Sent: Saturday, December 24, 2022 9:27 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function

Re: [R] difference between script and a function....

2022-12-24 Thread Ivan Krylov
On Sat, 24 Dec 2022 15:47:14 + akshay kulkarni wrote: > How do you debug if there is an error, particularly if I run the > script from the BASH prompt? Post-mortem debugging for non-interactive R scripts can be enabled by setting options(error = quote(dump.frames("A_SUITABLE_FILE_NAME",

Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
...but from the Linux prompt? Thanking you, Yours sincerely, AKSHAY M KULKARNI From: Ivan Krylov Sent: Saturday, December 24, 2022 8:52 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function On Sat, 24 Dec 2022 14:54

Re: [R] difference between script and a function....

2022-12-24 Thread Ivan Krylov
On Sat, 24 Dec 2022 14:54:52 + akshay kulkarni wrote: > If there is some error in the script, the error will be output to > the stdout? Or to the file that it creates for saving the output of > the script? When using Rscript: to stderr, to be precise. When using R CMD BATCH: to the Rout

Re: [R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
From: Andrew Simmons Sent: Saturday, December 24, 2022 8:18 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] difference between script and a function 1. The execution environment for a script is the global environment. Each R script run from a shell

Re: [R] difference between script and a function....

2022-12-24 Thread Andrew Simmons
1. The execution environment for a script is the global environment. Each R script run from a shell will be given its own global environment. Each R session has exactly one global environment, but you can have several active R sessions. 2. Using return in a script instead of a function will throw

[R] difference between script and a function....

2022-12-24 Thread akshay kulkarni
Dear members, I will be running scripts automatically in RHEL with crontab. I want to know the differences between running a script and a function. in particular: 1. An execution environment will be created for the function. what about a script? Is the

Re: [R] Difference in offset values in R and STATA

2020-04-14 Thread Patrick (Malone Quantitative)
Also, is the default base for "log" the same in both programs? On Tue, Apr 14, 2020 at 3:36 PM Sorkin, John wrote: > > Your question is unlikely to be answered unless you post code demonstrating > the problem > J > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics

Re: [R] Difference in offset values in R and STATA

2020-04-14 Thread Sorkin, John
Your question is unlikely to be answered unless you post code demonstrating the problem J John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center

[R] Difference in offset values in R and STATA

2020-04-14 Thread Haddison Mureithi
Hae guys, When performing a poisson regression sometimes one has to input the offset/exposure variable to account for individual time spent in a certain therapy before acquiring a certain condition of interest, whereby in r offset(log(months)) and in STATA offset(log(months)) results differ.

[R] Difference between cor_auto (qgraph package) and lavCor (lavaan package)

2019-04-19 Thread Enjalbert Line via R-help
Hello, I would like to know the diffrence between 2 commands : cor_auto (from qgraph package) and lavCor (from lavaan package) to compute a polychoric correlation matrix in order to do a network analysis. I have the responses to the SF-36 questionnaire (36 items with ordered responses) and I

Re: [R] difference between ifelse and if...else?

2017-12-13 Thread MacQueen, Don
Because ifelse is not intended to be an alternative to if ... else. They exist for different purposes. (besides the other replies, a careful reading of their help pages, and trying the examples, should explain the different purposes). -- Don MacQueen Lawrence Livermore National Laboratory 7000

Re: [R] difference between ifelse and if...else?

2017-12-13 Thread Duncan Murdoch
On 13/12/2017 10:31 AM, Jinsong Zhao wrote: Hi there, I don't know why the following codes are return different results. > ifelse(3 > 2, 1:3, length(1:3)) [1] 1 > if (3 > 2) 1:3 else length(1:3) [1] 1 2 3 Any hints? The documentation in the help page ?ifelse and ?"if" explains it pretty

Re: [R] difference between ifelse and if...else?

2017-12-13 Thread Eric Berger
ifelse returns the "shape" of the first argument In your ifelse the shape of "3 > 2" is a vector of length one, so it will return a vector length one. Avoid "ifelse" until you are very comfortable with it. It can often burn you. On Wed, Dec 13, 2017 at 5:33 PM, jeremiah rounds

Re: [R] difference between ifelse and if...else?

2017-12-13 Thread jeremiah rounds
ifelse is vectorized. On Wed, Dec 13, 2017 at 7:31 AM, Jinsong Zhao wrote: > Hi there, > > I don't know why the following codes are return different results. > > > ifelse(3 > 2, 1:3, length(1:3)) > [1] 1 > > if (3 > 2) 1:3 else length(1:3) > [1] 1 2 3 > > Any hints? > > Best, >

[R] difference between ifelse and if...else?

2017-12-13 Thread Jinsong Zhao
Hi there, I don't know why the following codes are return different results. > ifelse(3 > 2, 1:3, length(1:3)) [1] 1 > if (3 > 2) 1:3 else length(1:3) [1] 1 2 3 Any hints? Best, Jinsong __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R] difference-in-difference method for estimating causal impact,

2017-04-18 Thread Ralf Pfeiffer via R-help
Hello, i want to estimate the causal impact on a scale variable, using the difference-in-difference-method and the following 4 groups - control- and treatment group (counterfactual analysis) - two periods, measurement before and after treatment.  After discovering and estimating the

Re: [R] Difference between console output of cat and print

2017-04-17 Thread Bert Gunter
Well,... cat() is as Jeff describes. However, print() is a generic function (see ?UseMethod) for which there are literally hundreds of different methods that may do far more/different than merely output character strings. For example, the print method for trellis objects, print.trellis, draws a

Re: [R] Difference between console output of cat and print

2017-04-17 Thread Jeff Newmiller
Please stop posting html email per the Posting Guide. You are only going to reduce the chance of successfully communicating your questions to experienced users on this list. Re cat vs print: the purpose of print is to show values much as they are entered in source code, so quotes and escaped

[R] Difference between console output of cat and print

2017-04-17 Thread Data MagicPro
Since both *cat * as well as * print * create a character vector for outputing on the screen. Still both give different results as apparant below. My query is why so ? > cat(10) 10 > print(10) [1] 10 Why is the [1] of index number missing in case of *cat *? Thanks Ramnik [[alternative

Re: [R] difference metric info of same font on different device

2017-04-08 Thread Jinsong Zhao
On 2017/4/7 23:13, Jeff Newmiller wrote: I think it is a fundamental characteristic of graphics drivers that output will look different in the details... you are on a wild goose chase. Postscript in particular has a huge advantage in font presentation over other graphics output mechanisms.

Re: [R] difference metric info of same font on different device

2017-04-08 Thread Jinsong Zhao
On 2017/4/7 23:13, Jeff Newmiller wrote: I think it is a fundamental characteristic of graphics drivers that output will look different in the details... you are on a wild goose chase. Postscript in particular has a huge advantage in font presentation over other graphics output mechanisms.

Re: [R] difference metric info of same font on different device

2017-04-07 Thread Jeff Newmiller
I think it is a fundamental characteristic of graphics drivers that output will look different in the details... you are on a wild goose chase. Postscript in particular has a huge advantage in font presentation over other graphics output mechanisms. -- Sent from my phone. Please excuse my

[R] difference metric info of same font on different device

2017-04-07 Thread Jinsong Zhao
Hi there, I try to plot with custom fonts, which have good shape Latin and CJK characters. I set up all the fonts correctly. However, when I plot the same code on png() and postscript(), I get different result. The main problem is the space between characters is narrower in postscript() than

Re: [R] Difference between R for the Mac and for Windows

2017-04-01 Thread peter dalgaard
[This is drifting somewhat awy from the original intention of the topic, I think]. This looks like a build dependency. I get 3.3.2 (yeah, I know, should upgrade): > (1+2i)/0 [1] NaN+NaNi R-devel, march 24: > (1+2i)/0 [1] Inf+Infi on the *same* machine. The difference is that one is stock

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread Berend Hasselman
> On 31 Mar 2017, at 19:28, John McKown wrote: > > On Fri, Mar 31, 2017 at 12:15 PM, Berend Hasselman wrote: > > I have noted a difference between R on macOS en on Kubuntu Trusty (64bits) > with complex division. > I don't know what would happen

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread John McKown
On Fri, Mar 31, 2017 at 12:15 PM, Berend Hasselman wrote: > > I have noted a difference between R on macOS en on Kubuntu Trusty (64bits) > with complex division. > I don't know what would happen R on Windows. > > R.3.3.3: > > macOS (10.11.6) > - > > (1+2i)/0 > [1]

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread Uwe Ligges
On 31.03.2017 19:15, Berend Hasselman wrote: I have noted a difference between R on macOS en on Kubuntu Trusty (64bits) with complex division. I don't know what would happen R on Windows. R.3.3.3: macOS (10.11.6) - (1+2i)/0 [1] NaN+NaNi (-1+2i)/0 [1] NaN+NaNi 1i/0

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread Berend Hasselman
I have noted a difference between R on macOS en on Kubuntu Trusty (64bits) with complex division. I don't know what would happen R on Windows. R.3.3.3: macOS (10.11.6) - > (1+2i)/0 [1] NaN+NaNi > (-1+2i)/0 [1] NaN+NaNi > > 1i/0 [1] NaN+NaNi > 1i/(0+0i) [1] NaN+NaNi

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread Ista Zahn
The only place I've noticed differences is in encoding and string sorting, both of which are locale and library dependent. Best, Ista On Mar 31, 2017 8:14 AM, "Neil Salkind" wrote: > Can someone please direct me to an answer to the question as to how R > differs for

Re: [R] Difference between R for the Mac and for Windows

2017-03-31 Thread peter dalgaard
File encodings differ when you move outside of standard ASCII code. Not really R's problem, but it is a fly in the ointment when teaching classes with mixed laptop armoury and there are also differences between classroom and desktop computers. RStudio does have features to switch encodings, but

Re: [R] Difference between R for the Mac and for Windows

2017-03-30 Thread David Winsemius
> On Mar 30, 2017, at 8:40 PM, Boris Steipe wrote: > > I can't remember having seen my students write code that runs correctly on > one platform but not the other. Obviously under the hood there are > significant differences, but as far as code goes, R seems quite

Re: [R] Difference between R for the Mac and for Windows

2017-03-30 Thread Boris Steipe
I can't remember having seen my students write code that runs correctly on one platform but not the other. Obviously under the hood there are significant differences, but as far as code goes, R seems quite foolproof. There are GUI differences in base R - but AFAIK no such differences in the

[R] Difference between R for the Mac and for Windows

2017-03-30 Thread Neil Salkind
Can someone please direct me to an answer to the question as to how R differs for these two operating systems, if at all? Thanks - Neil __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

[R] Difference in Generalized Extreme Value distribution parameter estimations using lmom and fExtremes

2017-01-03 Thread Amelia Marsh via R-help
Dear R forum I have following dataset amounts =

Re: [R] difference

2016-10-29 Thread P Tennant
Hi, As Jeff said, more than one grouping variable can be supplied, and there is an example at the bottom of the help page for ave(). The same goes for by(), but the order that you supply the grouping variables becomes important. Whichever grouping variable is supplied first to by() will

Re: [R] difference

2016-10-28 Thread Jeff Newmiller
Now would be an excellent time to read the help page for ?ave. You can specify multiple grouping variables. -- Sent from my phone. Please excuse my brevity. On October 28, 2016 7:28:44 PM PDT, Ashta wrote: >Hi all thank you very much for your help. Worked very well for that

Re: [R] difference

2016-10-28 Thread Ashta
Hi all thank you very much for your help. Worked very well for that data set. I just found out that one of the data sets have another level and do the same thing, I want to calculate the difference between successive row values (num) to the first row value within city and year. city, year, num

Re: [R] difference

2016-10-28 Thread Jeff Newmiller
Haven't seen a solution using ave... d$diff <- ave( d$num, d$year, FUN = function( v ) { v - v[ 1 ] } ) -- Sent from my phone. Please excuse my brevity. On October 28, 2016 12:46:15 PM CDT, William Dunlap via R-help wrote: >You could use match() to find, for each row,

Re: [R] difference

2016-10-28 Thread William Dunlap via R-help
You could use match() to find, for each row, the index of the first row with the give row's year: > d <- data.frame(year=c(rep(2001, 3), rep(2002, 3)), num=c(25,75,150,30,85,95)) > indexOfFirstOfYear <- with(d, match(year, year)) > indexOfFirstOfYear [1] 1 1 1 4 4 4 > d$diff <-

Re: [R] difference

2016-10-28 Thread jim holtman
I read the problem incorrectly; I did not see that you wanted the difference from the first entry; trying again: > require(dplyr) > input <- read.table(text = "Year Num + 200125 + 200175 + 2001 150 + 200230 + 200285 + 200295", header = TRUE) > > input %>% +

Re: [R] difference

2016-10-28 Thread jim holtman
Here are a couple of other ways using 'dplyr' and 'data.table' > require(dplyr) > input <- read.table(text = "Year Num + 200125 + 200175 + 2001 150 + 200230 + 200285 + 200295", header = TRUE) > > input %>% + group_by(Year) %>% + mutate(diff = c(0, diff(Num)))

Re: [R] difference

2016-10-28 Thread P Tennant
Hi, You could use an anonymous function to operate on each `year-block' of your dataset, then assign the result as a new column: d <- data.frame(year=c(rep(2001, 3), rep(2002, 3)), num=c(25,75,150,30,85,95)) d$diff <- unlist(by(d$num, d$year, function(x) x - x[1])) d year

[R] difference

2016-10-27 Thread Ashta
Hi all, I want to calculate the difference between successive row values to the first row value within year. How do I get that? Here isthe sample of data Year Num 200125 200175 2001 150 200230 200285 200295 Desired output Year Num diff 200125 0 2001

Re: [R] Difference subsetting (dataset$variable vs. dataset["variable"]

2016-05-31 Thread Jeff Newmiller
You were clearly mistaken. dataframe$column is almost the same as dataframe[["column"]], except that the $ does partial matching. Both of these "extract" a list element. A data frame is a list where all elements are vectors of the same length. A list is a vector where each element can refer

[R] Difference subsetting (dataset$variable vs. dataset["variable"]

2016-05-31 Thread G . Maubach
Hi All, I thought dataset$variable is the same as dataset["variable"]. I tried the following: > str(ZWW_Kunden$Branche) chr [1:49673] "231" "151" "151" "231" "231" "111" "231" "111" "231" "231" "151" "111" ... > str(ZWW_Kunden["Branche"]) 'data.frame':49673 obs. of 1 variable: $

Re: [R] difference between require and library

2016-04-27 Thread Thierry Onkelinx
Dear Jean, Have a look at http://stackoverflow.com/questions/5595512/what-is-the-difference-between-require-and-library Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics &

[R] difference between require and library

2016-04-27 Thread MAURICE Jean - externe
Hi, Is there any other difference between 'require' and 'library' than the error or warning when the library is not found ? Jean in France Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y

Re: [R] difference between successive values

2016-03-05 Thread Jim Lemon
Hi catalin, I think what you are trying to do is to retrieve the original observations from the cumulated values. In that case Olivier's suggestion will do what you want: c(x[1],diff(x)) Jim On Sat, Mar 5, 2016 at 1:59 AM, catalin roibu wrote: > I mean the first row

Re: [R] difference between successive values

2016-03-04 Thread catalin roibu
I mean the first row value În Vin, 4 mar. 2016, 16:15 Jeff Newmiller, a scris: > "Keep the first values" is imprecise, but mixing an absolute value with a > bunch of differences doesn't usually work out well. I frequently choose > among > > x <- sample( 10 ) > dxright

Re: [R] difference between successive values

2016-03-04 Thread Jeff Newmiller
"Keep the first values" is imprecise, but mixing an absolute value with a bunch of differences doesn't usually work out well. I frequently choose among x <- sample( 10 ) dxright <- c( 0, diff(x) ) dxleft <- c( diff(x), 0 ) for calculation purposes depending on my needs. -- Sent from my

Re: [R] difference between successive values

2016-03-04 Thread Olivier Crouzet
Hi, (1) You should provide a minimal working example; (2) But anyway, does... x = sample(10) c(x[1],diff(x)) ... do what you want? Olivier. On Fri, 4 Mar 2016 13:22:07 +0200 catalin roibu wrote: > Dear all! > > I want to calculate difference between successive

[R] difference between successive values

2016-03-04 Thread catalin roibu
Dear all! I want to calculate difference between successive values (cumulative values) with R. I used diff function, but I want to keep the first values. Please help me to solve this problem! Thank you! Best regards! CR -- - - Catalin-Constantin ROIBU ​ Lecturer PhD, Forestry engineer

[R] Difference MNP-package and rmnpGibbs from bayesm-package

2015-09-15 Thread A. Martinovici
Hi, The first thing to check is if both functions use the same 'base' option - they usually don't. On a more general note, the two approaches use a different data augmentation procedure, but this should not have a very large impact on the results provided enough draws and similar priors are

Re: [R] difference between write.csv(...) and write.table(..., sep=, )

2015-08-16 Thread Berend Hasselman
On 16-08-2015, at 16:38, Jinsong Zhao jsz...@yeah.net wrote: Hi there, I notice that write.csv is a wrap of write.table. However, I can't get the same results using both functions. Here is a reproducible example: x - matrix(1:6, nrow =2) rownames(x) - letters[1:2] colnames(x) -

Re: [R] difference between write.csv(...) and write.table(..., sep=, )

2015-08-16 Thread Marc Schwartz
On Aug 16, 2015, at 9:38 AM, Jinsong Zhao jsz...@yeah.net wrote: Hi there, I notice that write.csv is a wrap of write.table. However, I can't get the same results using both functions. Here is a reproducible example: x - matrix(1:6, nrow =2) rownames(x) - letters[1:2] colnames(x)

Re: [R] difference between write.csv(...) and write.table(..., sep=, )

2015-08-16 Thread Michael Dewey
I think that if you do ?write.csv and then page down to the section entitled CSV files the mystery will be solved for you in the first few paragraphs. On 16/08/2015 15:38, Jinsong Zhao wrote: Hi there, I notice that write.csv is a wrap of write.table. However, I can't get the same results

[R] difference between write.csv(...) and write.table(..., sep=, )

2015-08-16 Thread Jinsong Zhao
Hi there, I notice that write.csv is a wrap of write.table. However, I can't get the same results using both functions. Here is a reproducible example: x - matrix(1:6, nrow =2) rownames(x) - letters[1:2] colnames(x) - LETTERS[1:3] write.csv(x, ) ,A,B,C a,1,3,5 b,2,4,6 write.table(x, ,

[R] Difference between drop1() vs. anova() for Gaussian glm models

2015-07-20 Thread Karl Ove Hufthammer
Dear list members, I’m having some problems understanding why drop1() and anova() gives different results for *Gaussian* glm models. Here’s a simple example: d = data.frame(x=1:6, group=factor(c(rep(A,2), rep(B, 4 l = glm(x~group, data=d) Running the following code

Re: [R] Difference between drop1() vs. anova() for Gaussian glm models

2015-07-20 Thread peter dalgaard
I am somewhat surprised that _anything_ sensible comes out of anova.glm(l, test=Chisq). I think it is mostly expected that you use F tests for that case. What does seem to come out is the same as for drop1(l, test=Rao), which gives the scaled score test, which would seem to be equivalent to

Re: [R] Difference between 32-bit and 64-bit version

2015-06-04 Thread Thierry Onkelinx
Dear Duncan, I had been thinking about FAQ 7.31. I tried to create a dummy dataset with the same structure to replicate the problem with the need of sending my dataset. However all of them gave identical() results between 32-bit and 64-bit. Note that coef()$fRow is a 1266 x 6 data.frame. Is it

Re: [R] Difference between 32-bit and 64-bit version

2015-06-04 Thread Thierry Onkelinx
low probability of occurring was just statisticians lingo for rare ;-) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in

Re: [R] Difference between 32-bit and 64-bit version

2015-06-04 Thread Duncan Murdoch
On 04/06/2015 3:59 AM, Thierry Onkelinx wrote: Dear Duncan, I had been thinking about FAQ 7.31. I tried to create a dummy dataset with the same structure to replicate the problem with the need of sending my dataset. However all of them gave identical() results between 32-bit and 64-bit.

Re: [R] Difference between 32-bit and 64-bit version

2015-06-03 Thread Duncan Murdoch
On 03/06/2015 11:56 AM, Thierry Onkelinx wrote: Dear all, I'm a bit puzzled by the difference in an object when created in R 32-bit and R 64-bit. Consider the code below. test.rda is available at https://drive.google.com/file/d/0BzBrlGSuB9n-NFBWeC1TR093Sms/view?usp=sharing # Run in R

[R] Difference between 32-bit and 64-bit version

2015-06-03 Thread Thierry Onkelinx
Dear all, I'm a bit puzzled by the difference in an object when created in R 32-bit and R 64-bit. Consider the code below. test.rda is available at https://drive.google.com/file/d/0BzBrlGSuB9n-NFBWeC1TR093Sms/view?usp=sharing # Run in R 3.2.0 Windows 32-bit, lme4 1.1-8 library(lme4)

Re: [R] difference between max in summary table and max function

2015-02-16 Thread Franckx Laurent
] Sent: zaterdag 14 februari 2015 8:16 To: 'Martyn Byng'; r-help@r-project.org Cc: Franckx Laurent Subject: RE: [R] difference between max in summary table and max function I thought I'd chime in ... submitting the following: ?summary Provides the following documentation for the default

Re: [R] Difference in dates for unique ID

2015-02-15 Thread arun
HI Farnoosh, Not sure I understand the expected output. The difference between the first 2 days is 136 days May be this helps library(data.table) dcast.data.table(setDT(df)[, list(Visit=.N, Diff= as.numeric(abs(diff(as.Date(Date, format='%d-%b-%y') , by = ID],

Re: [R] Difference in dates for unique ID

2015-02-15 Thread farnoosh sheikhi via R-help
That's exactly what I was thinking. Thanks tons. Sent from Yahoo Mail on Android From:arun smartpink...@yahoo.com Date:Sun, Feb 15, 2015 at 2:47 AM Subject:Re: Difference in dates for unique ID HI Farnoosh, Not sure I understand the expected output.� The difference between the first 2 days

[R] difference between max in summary table and max function

2015-02-13 Thread Franckx Laurent
Dear all I have found out that the max in the summary of an integer vector is not always equal to the actual maximum of that vector. For example: testrow - c(1:131509) summary(testrow) Min. 1st Qu. MedianMean 3rd Qu.Max. 1 32880 65760 65760 98630 131500

Re: [R] difference between max in summary table and max function

2015-02-13 Thread Martyn Byng
Its a formatting thing, try summary(testrow,digits=20) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Franckx Laurent Sent: 13 February 2015 11:00 To: r-help@r-project.org Subject: [R] difference between max in summary table and max function Dear all

Re: [R] difference between max in summary table and max function

2015-02-13 Thread Allen Bingham
Byng Sent: Friday, February 13, 2015 3:15 AM To: Franckx Laurent; r-help@r-project.org Subject: Re: [R] difference between max in summary table and max function Its a formatting thing, try summary(testrow,digits=20) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org

[R] Difference between eigs() and eigen()

2014-12-29 Thread Pierrick Bruneau
Dear R users and contributors, I recently observed a difference between the outputs of the classic eigen() function, and the Arnoldi variant eigs() that extracts only the few first eigenpairs. Here is some sample code illustrating the problem: library(rARPACK) library(speccalt) set.seed(1) #

Re: [R] Difference between eigs() and eigen()

2014-12-29 Thread Uwe Ligges
eigs() is from a contributed package. No idea what it is about, but my guess is these are actually numerical differences coming from different algorithms used to calculate the eigenvalues. For details, please ask the author of the corresponding contributed package. Best, Uwe Ligges On

Re: [R] Difference in cummulative variance depending on print command

2014-12-07 Thread William Revelle
Dear Rena, As Peter points out, it is better to ask the maintainer of the program for detailed questions. As Peter correctly surmised, print.psych (which is used to print the output from the fa function), knows that you have an oblique solution and is reporting the amount of variance

Re: [R] Difference in cummulative variance depending on print command

2014-12-06 Thread peter dalgaard
Firstly, there is no fa() function in base R. There is one in package psych(), which has a maintainer, etc. I guess that it is because fa() does a non-orthogonal factor rotation and its print method knows about it, whereas the default print method for loadings assumes that rotations are

[R] Difference in cummulative variance depending on print command

2014-12-05 Thread Rena Büsch
Hello, I am trying a factor analysis via R. When running the pricipal axis analysis I do get different tables depending on the print command. This is my factor analysis: fa.pa_cor_3_2- fa(ItemsCor_4, nfactors=3, fm=pa,rotate=oblimin) To get the h2 I did the following print command: print

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-17 Thread peter dalgaard
This is pretty much standard. I'm quite sure that other stats packages do likewise and I wouldn't know who everyone is. It is not unheard of that textbook authors give suboptimal formulas in order not to confuse students, though. The basic point is that the t transformation gives the exact

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-17 Thread JLucke
$\rho= \rho_0 $ or $\rho_1 = \rho_2$. The two statistics will not be equivalent at $\rho=0$ because the statistics are based on different assumptions. Jeremy Miles jeremy.mi...@gmail.com Sent by: r-help-boun...@r-project.org 10/16/2014 07:32 PM To r-help r-help@r-project.org, cc Subject [R

[R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Jeremy Miles
I'm trying to understand how cor.test() is calculating the p-value of a correlation. It gives a p-value based on t, but every text I've ever seen gives the calculation based on z. For example: data(cars) with(cars[1:10, ], cor.test(speed, dist)) Pearson's product-moment correlation data:

Re: [R] Difference betweeen cor.test() and formula everyone says to use

2014-10-16 Thread Joshua Wiley
Hi Jeremy, I don't know about references, but this around. See for example: http://afni.nimh.nih.gov/sscc/gangc/tr.html the relevant line in cor.test is: STATISTIC - c(t = sqrt(df) * r/sqrt(1 - r^2)) You can convert *t*s to *r*s and vice versa. Best, Josh On Fri, Oct 17, 2014 at 10:32

[R] Difference in coefficients in Cox proportional hazard estimates between R and Stata, why?

2014-05-30 Thread Hiyoshi, Ayako
Dear R users, Hi, thank you so much for your help in advance. I have been using Stata but new to R. For my paper revision using Aalen's survival analysis, I need to use R, as the command including Aalen's survival seems to be available in R (32-bit, version 3.1.0 (2014-04-10)) but less ready

Re: [R] Difference in coefficients in Cox proportional hazard estimates between R and Stata, why?

2014-05-30 Thread Göran Broström
In the Cox regression case, the probable explanation is that you have ties in your data; Stata and coxph may have different defaults for handling ties. Read the manuals! The difference in sign in the other cases is simply due to different definitions of the models. I am sure it is well

Re: [R] Difference between comma separated values in column

2014-04-29 Thread arun
Hi, It is better to show the example data using ?dput().  Here, it is not clear whether the columns are character columns or lists. ##If it is the latter case dat1 - data.frame(V1=I(list(1:3, c(1,2,4), c(2,3,4,5))), V2= I(list(c(3,6,5), c(7,10,9), 2:5)))  dat1$V3 - mapply(`c`,mapply(`-`,

Re: [R] Difference between comma separated values in column

2014-04-29 Thread arun
HI, I guess this should be a bit faster. #1st case dat1$V3 - lapply(seq_along(dat1$V2),function(i) c(dat1$V2[[i]][-1] - head(dat1$V1[[i]],-1), tail(dat1$V1[[i]],1))) #2nd case dat2$V3 - unlist(lapply(seq_along(lst1[,2]),function(i) paste(c(lst1[,2][[i]][-1] - head(lst1[,1][[i]], -1),

Re: [R] Difference between times

2014-04-20 Thread Prof Brian Ripley
On 18/04/2014 21:46, David Winsemius wrote: On Apr 18, 2014, at 12:59 PM, Prof Brian Ripley wrote: On 18/04/2014 19:46, Rui Barradas wrote: Hello, The reason why is that you've misspelled CET (not CEST) Neither CET nor CEST are portable time-zone names. We have not been given the 'at a

Re: [R] Difference between times

2014-04-20 Thread Prof Brian Ripley
On 20/04/2014 08:50, Prof Brian Ripley wrote: On 18/04/2014 21:46, David Winsemius wrote: On Apr 18, 2014, at 12:59 PM, Prof Brian Ripley wrote: On 18/04/2014 19:46, Rui Barradas wrote: Hello, The reason why is that you've misspelled CET (not CEST) Neither CET nor CEST are portable

Re: [R] Difference between times

2014-04-20 Thread David Winsemius
On Apr 20, 2014, at 2:16 AM, Prof Brian Ripley wrote: On 20/04/2014 08:50, Prof Brian Ripley wrote: On 18/04/2014 21:46, David Winsemius wrote: On Apr 18, 2014, at 12:59 PM, Prof Brian Ripley wrote: On 18/04/2014 19:46, Rui Barradas wrote: Hello, The reason why is that you've

Re: [R] Difference between times

2014-04-19 Thread Nicola Sturaro Sommacal
Thank you for your reply. I discovered the OlsonNames() function to get the time-zone names in my system. Rui get a warning message when using a not recognized tz. On my system this doesn't succed. I solved as follow: dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz = Europe/Rome)

Re: [R] Difference between times

2014-04-19 Thread Nicola Sturaro Sommacal
I forgot: sysname release Linux 3.5.0-48-generic version #72-Ubuntu SMP Mon Mar 10 23:18:29 UTC 2014 2014-04-19 14:03 GMT+02:00 Nicola Sturaro Sommacal

[R] Difference between times

2014-04-18 Thread Nicola Sturaro Sommacal
Hi. I am new to POSIX and I'd like to understand the reason of this difference. dt1 = as.POSIXct(2014-03-29 09.00, format=%Y-%m-%d %H.%M) dt2 = as.POSIXct(2014-03-30 09.00, format=%Y-%m-%d %H.%M) dt2-dt1 dt1[1] 2014-03-29 09:00:00 CET dt2[1] 2014-03-30 09:00:00 CEST dt2-dt1 Time difference of

Re: [R] Difference between times

2014-04-18 Thread Rui Barradas
Hello, The reason why is that you've misspelled CET (not CEST) dt1 = as.POSIXct(2014-04-18 09.00, format=%Y-%m-%d %H.%M, tz = CEST) Warning messages: 1: In strptime(x, format, tz = tz) : unknown timezone 'CEST' 2: In as.POSIXct.POSIXlt(as.POSIXlt(x, tz, ...), tz, ...) : unknown timezone

Re: [R] Difference between times

2014-04-18 Thread Prof Brian Ripley
On 18/04/2014 19:46, Rui Barradas wrote: Hello, The reason why is that you've misspelled CET (not CEST) Neither CET nor CEST are portable time-zone names. We have not been given the 'at a minimum' information required by the posting guide, so please read ?Sys.timezone on your system.

Re: [R] Difference between times

2014-04-18 Thread David Winsemius
On Apr 18, 2014, at 12:59 PM, Prof Brian Ripley wrote: On 18/04/2014 19:46, Rui Barradas wrote: Hello, The reason why is that you've misspelled CET (not CEST) Neither CET nor CEST are portable time-zone names. We have not been given the 'at a minimum' information required by the

[R] Difference between two datetimes

2014-01-28 Thread David Fox
I have a data frame with variable datetime which is of class POSIXct. Consecutive observations are separated by 30 minutes. However, some of the differences reported by R give unexpected results. For example consider the following two consecutive entries: par.dat$datetime[5944] [1] 2010-04-04

Re: [R] Difference between two datetimes

2014-01-28 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David Fox Sent: Tuesday, January 28, 2014 5:15 PM To: r-help@r-project.org Subject: [R] Difference between two datetimes I have a data frame with variable datetime which

[R] Difference between arima(1, 1, 1) of y and arima(1, 0, 1) of diff(y)

2013-07-18 Thread George Milunovich
Dear all, When I run an arima(1,1,1) on an I(1) variable, y, I get different estimates to when I first difference the variable myself, e.g y2-diff(y), and then run arima(1,0,1) on y2. Shouldn't these two approaches give the same output? Any help will be much appreciated. george

[R] Difference between arima(1, 1, 1) for y and arima(1, 0, 1) for diff(y)

2013-07-18 Thread george
Dear all, When I run an arima(1,1,1) on an I(1) variable, e.g. y, I get different estimates to when I first difference the variable myself, e.g y2-diff(y), and then run arima(1,0,1) on y2. Shouldn't these two approaches give the same output? Any help will be much appreciated. george -- View

Re: [R] Difference between arima(1, 1, 1) of y and arima(1, 0, 1) of diff(y)

2013-07-18 Thread Mark Leeds
Hi George: Assuming it's still relevant, the link below will explain why. http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm On Thu, Jul 18, 2013 at 2:14 PM, George Milunovich george.milunov...@mq.edu.au wrote: Dear all, When I run an arima(1,1,1) on an I(1) variable, y, I get different

Re: [R] Difference between arima(1, 1, 1) of y and arima(1, 0, 1) of diff(y)

2013-07-18 Thread George Milunovich
Hi Mark, This is very helpful!! Much appreciated Sent from my iPad On Jul 19, 2013, at 3:51 AM, Mark Leeds marklee...@gmail.com wrote: Hi George: Assuming it's still relevant, the link below will explain why. http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm On Thu, Jul 18, 2013 at

[R] Difference between Lloyd and Forgy algorithms used in R built-in kmeans clustering function

2013-06-20 Thread Safiye Celik
Hi, Does anybody know the difference between the Lloyd and Forgy algorithms specified for R's kmeans clustering options? I know how Lloyd works, but I cannot access Forgy's paper and could not find any specific information on the web about how it really differs from Lloyd's method. I appreciate

  1   2   3   >