[R] Which version of R install for mac

2021-11-05 Thread Mark Don Young
I am having trouble finding a version of R install compatible with my mac. I have an older Macbook pro 2016 with the latest version of Big Slur 11.6. Intel core i5 2.9 Ghz-Dual-Core. Is there a version of R compatible with my computer? Thanks Mark [[alternative HTML version deleted]]

Re: [R] StructTS hang? TiThe fact

2019-06-29 Thread Don or Charlotte Smith
Sent from my iPhone __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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-con

Re: [R] Problem with Plotting in R

2018-12-19 Thread MacQueen, Don via R-help
im argument to plot(). -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 12/18/18, 6:17 AM, "R-help on behalf of rsherry8" wrote: Please consider the following R statements:

Re: [R] Different performance with different R versions

2018-12-12 Thread MacQueen, Don via R-help
Probably more appropriate for R-SIG-Mac -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 12/11/18, 12:22 AM, "R-help on behalf of cowan robin" wrote: I am running a small simulation, a

Re: [R] How to create gridded data

2018-11-14 Thread MacQueen, Don via R-help
.5 ## [2,] 3.2 5.0 1.8 2.0 ## From the original question: ## DF2 ## 6.1 4.5 7.8 5.5 ## 3.2 5.0 1.8 2.0 ## ... -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/13/18, 8:50 PM, "R-help on beha

Re: [R] missRanger package

2018-11-12 Thread MacQueen, Don via R-help
27;t make sense. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/12/18, 6:13 AM, "R-help on behalf of Rebecca Bingert" wrote: Hi, does anybody know where I need to insert the ce

Re: [R] Remove specific rows from nested list of matrices

2018-11-02 Thread MacQueen, Don via R-help
nt gets modified and that level is done; move up to the previous level and continue to its next element. At least, that's an approach that I think can work, but getting all the details correct will take some work. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Live

Re: [R] Speeding up R code - Apply a function to each row of a matrix using the dplyr package

2018-11-01 Thread MacQueen, Don via R-help
if (c==0) c(res1, res2) else c(res1, res2)*b } I suspect you can operate on the entire matrix, without looping (which both the apply() method, and the split/rbind method do, in effect), and if so it will be much faster. But I can't say for sure without more study. -- Don Ma

Re: [R] Plot a path

2018-10-31 Thread MacQueen, Don via R-help
Probably sort the data frame by date Then plot( mydf$geogr.longitude, mydf$geogr.latitude, type='l') Search the web for some tutorials See the help pages for plot plot.default -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 945

Re: [R] Gamma Simulation from Exponential Distribution: find sample size given power and sig.Level

2018-10-29 Thread MacQueen, Don via R-help
rally not a good idea. (and real names are preferred) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 10/28/18, 1:26 PM, "R-help on behalf of Black Yellow" wrote: I built my function

Re: [R] "logical indexing, " [was] match() question or needle haystack problem for a data.frame

2018-10-29 Thread MacQueen, Don via R-help
Wrong comparisons, I think. The opposite of A & B is !(A & B) There is no single operator that can replace the "&" in A & B that gives the "opposite" -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 9455

Re: [R] date and time data on x axis

2018-10-29 Thread MacQueen, Don via R-help
lot margins ( see ?par ) This expression op <- par(mar = c(4, 0, 0, 0) + par("mar")) is a way to modify the values of the "mar" parameter. Type the following commands par('mar') par()$mar## an alternative c(4,0,0,0) + par('mar')

Re: [R] Genuine relative paths with R

2018-10-08 Thread MacQueen, Don via R-help
rectory to the project's main directory. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 10/6/18, 4:48 AM, "R-help on behalf of Olivier GIVAUDAN" wrote: Dear R users, I

Re: [R] How can I create a loop for this? Please help me

2018-10-05 Thread MacQueen, Don via R-help
n') ## write the current columns to .GlobalEnv assign( nmi, sic) } ## now compare s1 with sd1, s2 with sd2, etc. ## they should be the same ## using assign() in this way is often recommended against. An alternative, which might be better depending on what you need to do with them, would

Re: [R] Sp-package overlay

2018-10-03 Thread MacQueen, Don via R-help
In addition, the function you want is sp::over or its equivalent in sf -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 10/2/18, 1:41 PM, "R-help on behalf of Ben Tupper" wrote: Hi,

Re: [R] From for loop to lappy?

2018-10-01 Thread MacQueen, Don via R-help
Try A <- lapply(file.names, function(fn) extract_tables(fn) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 10/1/18, 3:32 PM, "R-help on behalf of Ek Esawi" wrote: Hi All—

Re: [R] Printing standard notation and scientific notation in the same column of a dataframe

2018-09-27 Thread MacQueen, Don via R-help
t you'll get nicer to read numbers. (as an aside, I'll claim that this is an example of the power of open-source software -- if you don't like the defaults, one can make one's own version to work however is desired -- but it does take some work) -- Don MacQueen Lawrence Liv

Re: [R] Access function as text from package by name

2018-09-27 Thread MacQueen, Don via R-help
Or sink('stuff.txt') ; graphics::box ; sink() to have it in a text file. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 9/27/18, 4:55 AM, "R-help on behalf of Rui Barradas"

Re: [R] Summarizing R script

2018-09-26 Thread MacQueen, Don via R-help
I wonder if the lintr package might be helpful. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 9/26/18, 7:00 AM, "R-help on behalf of Spencer Brackett" wrote: R users, Is an

Re: [R] For Loop

2018-09-24 Thread MacQueen, Don via R-help
ut "very little use" would be too broad a generalization. It will depend on what problems are being solved. Finally, if using the loop in this case, it's true that s must exist before the statement is run. But that's not much of a problem. Just put s <- numeric( len-1) be

Re: [R] How to vectorize this function

2018-09-20 Thread MacQueen, Don via R-help
You're asking me? I prefer > 4/2 [1] 2 not > 1/2*4 [1] 2 (I think that's what I said) And if I did want to multiply by the reciprocal, which does happen from time to time, I'd certainly do it this way: (1/2)*4 -Don -- Don MacQueen Lawrence Livermore National Laborat

Re: [R] How to vectorize this function

2018-09-20 Thread MacQueen, Don via R-help
rt(gamma + y) + ifelse(callM <= call0, -1, 1) * sqrt(gamma - y)) incidentally, I would write sig <- (sqrt(gamma + y) - sqrt(gamma - y))/sqrt(T) instead of sig <- 1/sqrt(T)*(sqrt(gamma + y) - sqrt(gamma - y)) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave.,

Re: [R] as.Date and ylim in empty plot

2018-09-19 Thread MacQueen, Don via R-help
is(1, at= pretty(drng), lab=format(pretty(drng))) and if you prefer some other date format, specify it in the call to format() Did you intend to reverse the direction of your y axis? -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-106

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread MacQueen, Don via R-help
first few rows of each of the first few groups. That would be enough to test with. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 9/17/18, 11:54 AM, "R-help on behalf of Rich Shepard" wr

Re: [R] Applying by() when groups have different lengths

2018-09-17 Thread MacQueen, Don via R-help
x). So you have to operate on x inside the function. For sure, the fact that the subgroups have different numbers of rows is not the problem. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 9/17/1

Re: [R] New to R

2018-09-14 Thread MacQueen, Don via R-help
will "convert" it to a CSV (assuming that's what you meant by "CVS". -Don p.s. use reply-all if you want to add that extra information . -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509

Re: [R] sink() output to another directory

2018-09-13 Thread MacQueen, Don via R-help
In my experience, any path that can be used at the shell prompt in a unix-alike can be used anywhere that R wants a file name. [that is, when running R on a unix-alike system, and when pwd at the shell prompt returns the same value as getwd() in R] Hopefully, that helps... -Don -- Don

Re: [R] histogram in GNU R....

2018-09-07 Thread MacQueen, Don via R-help
In addition to the other suggestions, try typing x11() before using hist(). That *should* start a graphics window. If it does not, then type capabilities() and see if "X11" is TRUE. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA

Re: [R] Display time of PDF plots

2018-09-05 Thread MacQueen, Don via R-help
onth, or the 15th, or end or whatever makes sense rain.by.mon$mondt <- as.Date(paste0(rain.by.mon$mon,'-1')) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 9/4/18, 9:41 AM, "R-help on

Re: [R] r-data partitioning considering two variables (character and numeric)

2018-08-27 Thread MacQueen, Don via R-help
And yes, I ignored Genotype, but for the example data none of the stand_ID values are present in more than one Genotype, so it doesn't matter. If that's not true in general, then constructing the grp variable is a little more complex, but the principle is the same. -- Don MacQuee

Re: [R] r-data partitioning considering two variables (character and numeric)

2018-08-27 Thread MacQueen, Don via R-help
27;A-training', 'B-testing' ) split(mydata, grp) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/27/18, 3:54 PM, "R-help on behalf of Ahmed Attia" wrote: I would

Re: [R] Multiple counters in a single for loop

2018-08-24 Thread MacQueen, Don via R-help
might want to do with such a loop, R can do them without an explicit loop. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/24/18, 6:44 AM, "R-help on behalf of Deepa" wrote: Hello,

Re: [R] plotmath and logical operators?

2018-08-20 Thread MacQueen, Don via R-help
I was hoping to use plotmath to improve the appearance of the annotations -- but I now think it's not worth this kind of effort. I think I'm going to settle for mtext( as.character(subs) ). -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore,

[R] plotmath and logical operators?

2018-08-20 Thread MacQueen, Don via R-help
purpose, illustrated by this example: df <- data.frame(x=1:5, y=1:5) tmp <- expression(x >= 3 & y <= 3) tmpw <- expression(paste( x >= 3, " & ", y <= 3) ) with(df, eval(tmp)) [1] FALSE FALSE TRUE FALSE FALSE with(df, eval(tmpw)) [1] "FALSE & TRU

Re: [R] Understanding read.csv error message

2018-08-17 Thread MacQueen, Don via R-help
small typo in previous: should be quote="" (I left behind a single quote by mistake) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/17/18, 5:03 PM, "R-help on behalf of MacQueen,

Re: [R] Understanding read.csv error message

2018-08-17 Thread MacQueen, Don via R-help
ted by NA between a pair of commas? Or do you have successive commas with nothing between them for NA? Not sure what difference it will make, but it might affect what args you pass to read.table. Are you absolutely sure there are never any commas in the name? -Don -- Don MacQueen Lawrence Liverm

[R] Using rmarkdown with many plots created in a loop

2018-08-16 Thread MacQueen, Don via R-help
render it. It works, but it's cumbersome and difficult to get the rmd syntax correct. I would very much appreciate suggestions for a better way. Reproducible example below. Thanks -Don Example data (other data structures could be used), and an example using this approach. myd <- lap

Re: [R] searching for a specific row name in R

2018-08-15 Thread MacQueen, Don via R-help
ot;a list of identifier names". It's ok in ordinary English, but in R a "list" is a special kind of data structure. Better to say "a vector of identifier names". -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925

Re: [R] searching for a specific row name in R

2018-08-13 Thread MacQueen, Don via R-help
Or to return a logical value, i.e., TRUE if the column contains the value, FALSE if it does not: any( x[,2] == 'A501' ) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/13/18, 12:09 A

Re: [R] Resolving installed package updates warning

2018-08-10 Thread MacQueen, Don via R-help
't even look at the other error messages until that one has been solved. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/10/18, 9:53 AM, "R-help on behalf of Rich Shepard" wrote:

Re: [R] Resolving installed package updates warning

2018-08-10 Thread MacQueen, Don via R-help
I would start by trying to install rgdal by itself, rather than as part of a "batch" update. As in Install.packages('rgdal') My expectation is that you will see a more complete error message specific to rgdal, which presumably will provide a clue or pointer. -Don -- D

Re: [R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread MacQueen, Don via R-help
There are quite a few messages on R-sig-geo about installing rgdal on Ubuntu. Maybe one of them contains your solution? (I use Mac, so can't help directly) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724

Re: [R] error with the expand.grid command

2018-08-09 Thread MacQueen, Don via R-help
ons, I get: > class(time) [1] "function" > find('time') [1] "package:stats" -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/8/18, 11:20 PM, "R-help on behalf of Mayur T

Re: [R] Plot function: hourly data and x-axis

2018-08-09 Thread MacQueen, Don via R-help
t reviewing the posting guide and other advice shown at the bottom of every email sent by R-help. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 8/9/18, 7:51 AM, "R-help on behalf of Edoard

Re: [R] Combinations of true/false values where one pair is mutually exclusive

2018-08-02 Thread MacQueen, Don via R-help
<- expand.grid(D=tmp, E=tmp, F=tmp) > X <- subset(X, !(E=='f' & F=='f')) > X D E F 1 p p p 2 f p p 3 p f p 4 f f p 5 p p f 6 f p f -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509

Re: [R] read txt file - date - no space

2018-07-30 Thread MacQueen, Don via R-help
Xct class rather than POSIXlt class) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/30/18, 4:03 PM, "R-help on behalf of Jim Lemon" wrote: Hi Diego, You may have to do some co

Re: [R] Formatting summary() output to a file

2018-07-27 Thread MacQueen, Don via R-help
Hmmm. I do get output in the file with the first example, and the second example is too complicated for me. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/27/18, 9:56 AM, "R-help on beha

Re: [R] Formatting summary() output to a file

2018-07-27 Thread MacQueen, Don via R-help
w how to format complex objects, you could start with > ?print.data.frame > ?print.default > ?print (3) Note that if you use sink(), print(), sink() the way I suggested, then subsequently you can append to the file using sink('wysumallyrs.txt', append=TRUE) {print or cat or w

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
Harold, I don't have much experience with ODBC/RODBC, but given that it's working on Win, a driver problem seems plausible. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/26/18, 9:37

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
se if that's useful. I prefer to use packages that are based on the DBI package. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/25/18, 7:57 AM, "R-help on behalf of Doran, Harold" w

Re: [R] A couple of batch mode questions

2018-07-25 Thread MacQueen, Don via R-help
upplying them or parsing them might be different. I'm not sure, since I don't do this very often, and never use CMD BATCH. But it would be worth checking. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724

Re: [R] optim function

2018-07-13 Thread MacQueen, Don via R-help
There's a CRAN Task View on optimization. There might be something useful there. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/13/18, 11:43 AM, "R-help on behalf of Federico Becerr

Re: [R] (no subject)

2018-07-11 Thread MacQueen, Don via R-help
Maybe I missed it, but I didn't see anyone suggest a visit to the CRAN Spatial task view. This would be a good place to start learning how to work with spatial data in R. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab

Re: [R] R couldnt recognize US Pasific timezome

2018-07-09 Thread MacQueen, Don via R-help
Or (perhaps preferably) "US/Pacific" for daylight savings time support. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 7/9/18, 1:46 AM, "R-help on behalf of Jeff Newmiller" wrote:

Re: [R] inconsistency in display of character vector....

2018-07-08 Thread MacQueen, Don via R-help
not necessary ## testing for FALSE does not need == "FALSE" # if(identical(snlcqn,snlcqna) == "FALSE"){ # return(snlcqna) } # # else{ # return(snlcqn)

Re: [R] trouble with exiting loop if condition is met

2018-06-28 Thread MacQueen, Don via R-help
Does this example help? > for (ii in 1:10) { cat( ii,'\n') ; if (ii >3) break } 1 2 3 4 The loop won't stop unless you tell it to stop, and I don't see any place where you told it to stop. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-6

Re: [R] as.Date and Legend in a plot

2018-06-22 Thread MacQueen, Don via R-help
ld* have had an error on your second try: > as.Date(1998-02-10) Error in as.Date.numeric(1998 - 2 - 10) : 'origin' must be supplied -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 6

Re: [R] numeric comparison error

2018-06-18 Thread MacQueen, Don via R-help
What Jeff, said, plus to see it explicitly: > print(cpgbins[5:7], digits=18) [1] 0.200011 0.25 0.300044 > print(c(0.2, 0.25, 0.3), digits=18) [1] 0.200011 0.25 0.299989 -Don -- Don MacQueen Lawrence Liv

Re: [R] subsetting lists....

2018-06-18 Thread MacQueen, Don via R-help
[1] "2" "b" "4" However, > lapply( 1:length(YH), function(i) { YH[[i]][iuhV[i]]}) [[1]] [1] 2 [[2]] [1] "b" [[3]] [1] 4 -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509

Re: [R] rgdal in 3.5 fails(?)

2018-06-15 Thread MacQueen, Don via R-help
In case no one else has made the suggestion yet, take this question to R-sig-geo, where there has already been discussion and sharing of information and experiences about this. You'll need to include the output of sessionInfo(). -Don -- Don MacQueen Lawrence Livermore National Laboratory

Re: [R] Calling r-scripts with arguments from other scripts, or possibly R programming conventions/style guide

2018-06-13 Thread MacQueen, Don via R-help
tion, RecenterPeriods), fileConn) close(fileConn) looks to me like it's more complex than needed. I would suggest cat( TotalDeviation, IndividualDeviation, RecenterPeriods, '\n', file='output.txt') -- Don MacQueen Lawrence Livermore National Laboratory 7000 East

Re: [R] Time and date conversion

2018-06-06 Thread MacQueen, Don via R-help
fy the timezone when coverting from character to datetime is using the 'tz' argument. A timezone as part of the character string will be ignored (see the formatting codes in ?strptime). I almost always use as.POSIXct() instead of strptime() for conversion from character to datetime

Re: [R] Time-series moving average question

2018-06-01 Thread MacQueen, Don via R-help
about your same 8 point forecast values question, not without running it myself, but I would say that if the data really is different, yet the forecasts are the same, it would have to be coincidental. But a priori this seems unlikely, so I’d inspect your script very carefully for mistakes. -Don

Re: [R] Time-series moving average question

2018-06-01 Thread MacQueen, Don via R-help
arning comes from the second step. Print tnr.ma and you will see some NAs. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509   From: Bill Poling Date: Friday, June 1, 2018 at 8:58 AM To: "MacQueen, Don"

Re: [R] Time-series moving average question

2018-06-01 Thread MacQueen, Don via R-help
ould be helpful to say which package. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 6/1/18, 4:20 AM, "R-help on behalf of Bill Poling" wrote: Good morning, I hope someone can help

Re: [R] how to make the code more efficient using lapply

2018-05-25 Thread MacQueen, Don via R-help
ne, there might be a speedup from converting to a matrix and using rbind() on matrices. Data frames have some overhead that matrices don't, especially if factors are involved. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 L

Re: [R] Manipulation of data.frame into an array

2018-05-24 Thread MacQueen, Don via R-help
se on an array object: > array(1:12, dim=c(2,3,2)) , , 1 [,1] [,2] [,3] [1,]135 [2,]246 , , 2 [,1] [,2] [,3] [1,]79 11 [2,]8 10 12 > > array(1:12, dim=c(2,3,2))[[1]] [1] 1 But "[[ ]]" does make sense on a list object. -- Don M

Re: [R] Loop Function to Create Multiple Scatterplots

2018-05-21 Thread MacQueen, Don
as a text string within the loop, and use that in the plot() call. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 5/20/18, 4:05 PM, "R-help on behalf of STEVEN MANCINI" wrote: Hell

Re: [R] add one variable to a data frame

2018-05-11 Thread MacQueen, Don
Of course... Thanks -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 5/11/18, 3:50 PM, "R-help on behalf of peter dalgaard" wrote: Um, maybe just dat1$C <- match(dat1$B,

Re: [R] add one variable to a data frame

2018-05-11 Thread MacQueen, Don
ata set, which is essentially what was asked for (in my view). -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 5/11/18, 1:36 PM, "R-help on behalf of Bert Gunter" wrote: Sarah et. al.:

Re: [R] add one variable to a data frame

2018-05-11 Thread MacQueen, Don
log 3 8 8 1_log 3 9 9 1_log 3 10 10 1_log 3 11 11 3_cat 4 12 12 3_cat 4 As a single line command: dat1$C <- seq(length(unique(dat1$B)))[ match( dat1$B, unique(dat1$B) )] -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1

Re: [R] the first name of the first column

2018-05-10 Thread MacQueen, Don
b: num 4 4 1 1 2 1 4 2 2 4 ... Try it on your data. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 5/10/18, 2:36 PM, "R-help on behalf of greg holly" wrote: Dear all;

Re: [R] the first name of the first column

2018-05-10 Thread MacQueen, Don
ot;Datsun 710" "Hornet 4 Drive" "Hornet Sportabout" "Valiant"(etc) Perhaps you should make a copy of my_data that includes only the numeric columns? -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Li

Re: [R] using for loop with data frames.

2018-05-10 Thread MacQueen, Don
n which case you would never create separate data frames df_bs_id1, df_bs_id2, etc. I have used both approaches at various times over the years, and each has pros and cons. In general, I would recommend the list approach, however, especially if you have a large number of files to process. -Don -- D

Re: [R] Seasonal weekly average

2018-05-09 Thread MacQueen, Don
) [1] "19" > format( as.Date('2018-1-1') , '%V') [1] "01" > format( as.Date('2018-1-8') , '%V') [1] "02" -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062

Re: [R] Dinamic variables in loop

2018-05-09 Thread MacQueen, Don
write in for loop". Do you want the new data frame printed at each iteration? In that case, try putting print(newMyData) inside the loop. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 5/8/

Re: [R] help with json data from the web into data frame in R

2018-05-09 Thread MacQueen, Don
cks up the options. [my context was running install.packages( method='curl' ) pointing to a local repository] Whether the .curlrc file goes in the local working directory, or your home directory, I'm not sure anymore. I've tried both. -Don -- Don MacQueen Lawrence Livermore Nationa

Re: [R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

2018-05-04 Thread MacQueen, Don
s to Duncan Murdoch for pointing out that the correct arguments are height and width, not length and width. And, yes, please send plain text email to R-help. Sending HTML email reduces the likelihood anyone will actually read your email. -Don -- Don MacQueen Lawrence Livermore National Laboratory

Re: [R] How to visualise what code is processed within a for loop

2018-04-30 Thread MacQueen, Don
working with them, then recombining them with the character columns. R’s performance working with data frames has improved since then, so I really don’t know if it would make a difference for your task. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA

Re: [R] Copy text from Script syntax into .txt

2018-04-25 Thread MacQueen, Don
Try putting this options(echo=TRUE) at the beginning of your script See ?source for a clue -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 4/24/18, 2:23 AM, "R-help on behalf of P. Roberto B

Re: [R] How to visualise what code is processed within a for loop

2018-04-25 Thread MacQueen, Don
maybe you're using it on a scalar (can't be sure about this, though) For example, ifelse() is designed for this kind of usage: > ifelse( c(TRUE, FALSE, TRUE) , 1:3, 11:13) [1] 1 12 3 Although it works ok for these > ifelse(TRUE, 3, 4) [1] 3 > ifelse(FALSE, 3, 4) [1] 4

Re: [R] Doubt_merging data

2018-04-09 Thread MacQueen, Don
you want. But some of your code suggests you have a somewhat complex data structure, so it's hard to say. extract() is not a base R function; when asking for help one should indicate where non-base functions come from. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East A

Re: [R] Creating the right table from lapply list

2018-03-28 Thread MacQueen, Don
leverly, or in a way that needs fewer intermediate variables ... but I don't really care. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 3/28/18, 9:32 AM, "R-help on behalf of orlin mitov via

[R] Help on Aggregation

2018-03-12 Thread Emeka Don
Dear All, 1.I have been trying to aggregate my data but I have not been getting it correctly. In the data I want to convert hourly data into daily averages. Here is a sample of the data: Neph_no Date Time Temp_C Pressure_kPa RH 9 2014/03/28 10:00:00 38.4 95.9 29.7 9 2014/03/28 11:00:00 37.8

[R] Adding a table of contents to html output using the bookdown package

2018-02-21 Thread MacQueen, Don
tents. Are there an additional argument I could add to this render() command to get a TOC? I've looked, and haven't been able to find one. Thanks -Don p.s. On the other hand, with render('test.Rmd', output_dir='.', output_format=pdf_document2(number_sections=TR

Re: [R] Package sgd

2018-02-05 Thread MacQueen, Don
ant. Plus, you could download sgd from the CRAN archives, and try building it yourself. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 2/5/18, 10:25 AM, "R-help on behalf of Bert Gunter"

Re: [R] Concatening two maps/shapefiles...

2018-02-05 Thread MacQueen, Don
package to load your shapefiles into R (you did mention shapefiles), and the basic plot() command to plot them. Depending on whether you choose to use the 'sp' package or the 'sf' package. See also the R-sig-geo mailing list. -Don -- Don MacQueen Lawrence Livermore National

Re: [R] Error while working with png output on linux server

2018-02-01 Thread MacQueen, Don
our installation. And probably, as Jeff Newmiller suggested, with which support software is or is not installed on the system. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 2/1/18, 6:50 AM, "R-help o

Re: [R] Help in Plotting in "fArma" Package

2018-01-26 Thread MacQueen, Don
will depend, as Dave indicated, on how the package author handled the plotting options in rsFit(). -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 1/25/18, 5:56 PM, "R-help on behalf of Davi

Re: [R] Packages couldn't load

2018-01-19 Thread MacQueen, Don
Or the openxlsx package, which does not require Java, and is similar to the xlsx package in functionality (both reads and writes, for example). -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 1/16/18, 4

[R] Packages couldn't load

2018-01-16 Thread Emeka Don
Dear All, I have been trying to install Xlsx package in R but i have been getting this error after the installation. Please can anyone help? > any(grepl("xlsx",installed.packages())) [1] TRUE > library("xlsx") Loading required package: rJava Error: package or namespace load failed for ‘rJava’: .

Re: [R] HOW TO FILTER DATA

2018-01-04 Thread MacQueen, Don
IPC == 'H04M001/02' | df$IPC == 'C07K016/26' ) IPC is a variable within the data frame, so it is unnecessary to include the data frame's name in the logical expression. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550

Re: [R] something weird has happened....!!!!!!!!!!

2017-12-15 Thread MacQueen, Don
y done one right after the other? Or could ZEEL.NS have changed in between? The function could be using a variable that's only defined in the global environment (presumably by mistake, but it's an easy mistake to make), and its value changed in between function calls. Reinstalling

Re: [R] Errors in reading in txt files

2017-12-14 Thread MacQueen, Don
times are not in the POSIXct default format. This example might indicate the idea: > as.POSIXct('2012-10-12 13:14') [1] "2012-10-12 13:14:00 PDT" > class(as.POSIXct('2012-10-12 13:14')) [1] "POSIXct" "POSIXt" -Don -- Don MacQueen Lawre

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] Fwd: Wanted to learn R Language

2017-11-30 Thread MacQueen, Don
there are other options. Pay careful attention to the stringsAsFactors argument of read.table, and I would suggest setting it to FALSE at first, at least until you learn enough about factors in R to know when to use them, and when not. -Don -- Don MacQueen Lawrence Livermore National Laboratory

Re: [R] Scatterplot of many variables against a single variable

2017-11-27 Thread MacQueen, Don
ething in ggplot2 or some other package. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/27/17, 12:56 AM, "R-help on behalf of Engin YILMAZ" wrote: Dear I try to realize o

Re: [R] Converting a string to variable names

2017-11-17 Thread MacQueen, Don
y)) you would have to do with(mydf$P1, plot(x,y)) (all of the above is untested, so watch out for typing errors) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/15/17, 2:22 PM, "R-help on beha

Re: [R] Convert poly line to polygon in R

2017-11-16 Thread MacQueen, Don
etter choice for loading a shapfile into R. See also the relatively new package named "sf". -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/13/17, 12:47 AM, "R-help on behalf of Jef

Re: [R] R-help

2017-11-09 Thread MacQueen, Don
A trip to the Spatial Task View on CRAN might be in order. The RandomFields package comes to mind. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509 On 11/9/17, 12:37 AM, "R-help on behalf of PIKAL

  1   2   3   4   5   6   7   8   9   >