Re: [R] Select

2019-02-11 Thread Jeff Newmiller
) On Mon, 11 Feb 2019, Val wrote: Sorry Jeff and David for not being clear! The total sample size should be at least 40, but the selection should be based on group ID. A different combination of Group ID could give at least 40. If I select group G1 with 25 count and G2 and wi

Re: [R] Select

2019-02-11 Thread Jeff Newmiller
This constraint was not clear in your original sample data set. Can you expand the data set to clarify how this requirement REALLY works? On February 11, 2019 3:00:15 PM PST, Val wrote: >Thank you David. > >However, this will not work for me. If the group ID selected then all >of its

Re: [R] Help needed with my code for merging multiple xls files from google drive

2019-02-11 Thread Jeff Newmiller
Your example is not reproducible [1][2][3], you are reposting a copy of an email in a fresh thread (instead of replying to the first one), and you are using HTML email format on a text-only mailing list (what you see is really not what we see). Please read the Posting Guide to find out what the

Re: [R] Recreate for loop without using for loop

2019-02-10 Thread Jeff Newmiller
There is a no-homework policy stated in the Posting Guide. On February 10, 2019 8:59:41 AM PST, Rima El-zein wrote: >Hi. > > > >Can someone please help me recreate this code without using a for loop? >Idk if I'm supposed to use a map function or something else. > > > >qprob <- function(pp) { > >

Re: [R] very slow code execution

2019-02-06 Thread Jeff Newmiller
e, 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-contained, reproducible code. --- Jeff Newmiller

Re: [R] CRAN Task View: Optimization and Mathematical Programming

2019-02-06 Thread Jeff Newmiller
Rich's email did not reach me, so tagging off of S Ellison's reply... Take a look at [1] for an example analysis that maximizes the firm yield (amount that can be promised and subsequently delivered for irrigation delivery each year) subject to required minimum capacity levels (for flood

Re: [R] Calendar Heat Map

2019-02-06 Thread Jeff Newmiller
figure out >how to >change my color scaling. While scale_fill_gradient(low="red", >high="green") >does what I ask, that is create a color gradient from red to green it >not >what I thought it would be. What I need is discreet colors something >like 0 >- grey

Re: [R] Help converting file to XTS

2019-02-06 Thread Jeff Newmiller
A NA NA NA >[233] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA >NA NA NA NA NA NA N > > >It seems like the indexing is somehow wrong, or am I missing something? >:) > > >Fra: Jeff Newmiller >Sendt: tirsdag 5. feb

Re: [R] data.frame() versus as.data.frame() applied to a matrix.

2019-02-05 Thread Jeff Newmiller
I have no idea about "why it is this way" but there are many cases where I would rather have to use backticks around syntactically-invalid names than deal with arbitrary rules for mapping column names as they were supplied to column names as R wants them to be. From that perspective, making the

Re: [R] problems when merging two data sets

2019-02-05 Thread Jeff Newmiller
There are many examples of how to do this properly on the web, and many ways you could have failed to follow those examples. You need to be much more specific (using actual R code) about what you did in order for us to help you get past your specific error. [1][2][3] You will also avoid the

Re: [R] Help converting file to XTS

2019-02-05 Thread Jeff Newmiller
One thing about POSIXct or POSIXlt... you always need to address the issue of timezone. If your timestamp data are simple (no daylight savings) you may be able to get away with a simple Sys.setenv( TZ="GMT" ) sometime in each R session prior to converting anything to this type (e.g at the

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-02-03 Thread Jeff Newmiller
lot( simresult$jd/365, simresult$NAlive ) plot( simresult$jd/365, simresult$NNotAlive ) plot( simresult$jd/365, simresult$NPreg ) # On Sat, 2 Feb 2019, Alan Feuerbacher wrote: On 1/29/2019 11:50 PM, Jeff Newmiller wrote: On Tue, 29 Jan 2019, Alan Feuerbacher wrote: After

Re: [R] load.wave

2019-02-02 Thread Jeff Newmiller
You aren't pushing any envelope... you slit it open and fell out somewhere on the sidewalk. I tossed your question into Google and it came back with [1] and [2]. Please do that yourself instead whenever you are tempted to go off topic. [1]

Re: [R] Why is there error in as.POSIXlt.character when using strftime()?

2019-02-02 Thread Jeff Newmiller
ot;%m/%d/%y")) >[1] "Date" >> class(strftime(strptime(dat, format="%m/%d/%y %H:%M"), format = >"%m/%d/%y")) >[1] "character" > >If I want to date caluculation, would as.Date() be more desirable? Or >does >strftime() do the s

Re: [R] Why is there error in as.POSIXlt.character when using strftime()?

2019-02-02 Thread Jeff Newmiller
t curious, what does strptime(), strftime(), as.POSIXlt.(), and >as.POSIXct() stand for? > >On Sat, Feb 2, 2019 at 10:41 AM Jeff Newmiller > >wrote: > >> ... and in general, you need to specify the time zone to avoid >surprises. >> In many cases this can be as simple as &

Re: [R] Why is there error in as.POSIXlt.character when using strftime()?

2019-02-02 Thread Jeff Newmiller
... and in general, you need to specify the time zone to avoid surprises. In many cases this can be as simple as Sys.setenv(TZ="GMT") but it can be specific to your data set also. On February 2, 2019 7:09:46 AM PST, Duncan Murdoch wrote: >On 01/02/2019 10:45 p.m., C W wrote: >> Dear R

Re: [R] create a network for a small text df

2019-02-01 Thread Jeff Newmiller
I an finding your question very opaque. For one thing, why aren't you specifying any edges? Since I don't do this kind of analysis normally I don't know what your combined graph should look like. Can you provide a link you what you hope to end up with? Note that the Posting Guide emphasizes

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-29 Thread Jeff Newmiller
On Tue, 29 Jan 2019, Alan Feuerbacher wrote: On 1/28/2019 7:51 PM, Jeff Newmiller wrote: If you forge on with your preconceptions of how such a simulation should be implemented then you will be able to reproduce your failure just as spectacularly using R as you did using Octave. I think

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Jeff Newmiller
If you forge on with your preconceptions of how such a simulation should be implemented then you will be able to reproduce your failure just as spectacularly using R as you did using Octave. It is crucial to employ vectorization of your algorithms if you want good performance with either

Re: [R] troubleshooting data structure to run krippendorff's alpha

2019-01-27 Thread Jeff Newmiller
I don't understand most of what you wrote, but when you say "matrix" you are mistaken. A matrix is NOT the same thing as a data frame, which is what you get when you call read.csv(). Read RShowDoc("R-intro") Sections 5 and 6... A data frame is a list of column vectors, while a matrix is a

Re: [R] positive deviance plot for Binomial distribution

2019-01-27 Thread Jeff Newmiller
tat.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-contained, reproducible code. --- Jeff NewmillerThe

Re: [R] cumulative data monthly

2019-01-27 Thread Jeff Newmiller
N = cumsum) plot(PMES ~ ym, data=datim) # My guess as to what you asked for? ### On Sun, 27 Jan 2019, Diego Avesani wrote: Dear  Jeff, Dear Rui, Dear all, I will try Rui's solution as soon as possible. If I could ask: As a first step, I would like to follow Jeff's suggestion. I will represent the precipitat

Re: [R] cumulative data monthly

2019-01-27 Thread Jeff Newmiller
Very succinct, Rui! One warning to Diego automatic data recorders tend to use the local standard timezone year-round. R by default assumes that timestamps converted from character to POSIXct using the current timezone on your computer... which may not be in the same zone that the logger

Re: [R] cumulative data monthly

2019-01-27 Thread Jeff Newmiller
Are you looking for a plot where each point represents a month? Or a plot where each point represents the accumulated precipitation so far that month? The latter seems closer to your computations so far, but doesn't seem like a typical way to present precipitation data... On January 27, 2019

Re: [R] Create a new list from selected items in another list

2019-01-26 Thread Jeff Newmiller
BBB <- lapply( CCC, function( v ) v[ 0 wrote: >Hi All-- > >I have a list which contain variables 0s at the end of each vector on >the isit. I want to create a new list with only numbers > 0. >It seems simple, but i tried several option, none of which worked. > >CCC <- list(A=c(1,2,3,0,0,0,0),

Re: [R] TIme Zone error

2019-01-26 Thread Jeff Newmiller
Read the help file ?as.POSIXct "" as time zone is not an error. On January 26, 2019 1:15:21 PM PST, Christofer Bogaso wrote: >Hi, > >I want to set a specific Timezone for my R environment, with below >syntax: > >> Sys.getenv("Asia/Calcutta") > >[1] "" > >> >But it sets to some blank timezone.

Re: [R] Function in default parameter value closing over variables defined later in the enclosing function

2019-01-24 Thread Jeff Newmiller
My objection to this design pattern is that this gives the default implementation of inside an ability that cannot be altered using functions provided by the caller. You might think this is what you want now but it has the potential to render the code unreusable in the future, which renders the

Re: [R] Error "sufficient values in manual scale. 10 needed but only 7 provided"

2019-01-23 Thread Jeff Newmiller
Problem is in your data not matching your values, but you did not share your data. Try using the unique() function to see what values you have in your data. I will say that when I want to assign discrete colors I always start by converting my character column in the data frame to a factor and

Re: [R] calculating quintile values of numeric data?

2019-01-22 Thread Jeff Newmiller
?range ?findInterval On January 22, 2019 6:54:14 PM PST, Kelly Thompson wrote: >I’d like to take numeric data, and calculate numeric “quintiles” with >integer values in from 1 – 5 , with values in the lowest 20% of values >having a value of 1, the >20 - <= 40% of values having a value of 2, >the

Re: [R] large number of scrollable histograms....

2019-01-22 Thread Jeff Newmiller
You can use knitr (child documents) with rmarkdown to generate an html file containing many htmlwidgets. There are many htmlwidgets you can choose from, see [1]. You can also use htmlwidgets with shiny if you prefer, though I don't know if you can get the many plots simultaneously with shiny.

Re: [R] Opening R

2019-01-20 Thread Jeff Newmiller
I don't see any attachments. I agree with Eric... depending on images in questions posed here is an unreliable strategy. Re: pop-up messages regarding re-installation on Windows... I have never seen that occur with R, but I have seen it with other programs years ago. There are settings that

Re: [R] data transformation

2019-01-20 Thread Jeff Newmiller
There is no "perhaps" about it. Nonsense phrases like "similar to logit, where I dont [sic] lose normality of the data" that lead into off-topic discussions of why one introduces transformations in the first place are perfect examples of why questions like this belong on a statistical theory

Re: [R] Printing a list of simultaneous equations

2019-01-18 Thread Jeff Newmiller
Don't use the default print method then. When you type an expression alone at the console it uses a print function to convert the result to characters for output. The default print method for matrices of character uses quotes to show the exact contents of each character string. Convert the

Re: [R] Colors on box plots in ggplot

2019-01-17 Thread Jeff Newmiller
I see you creating a variable p, evaluating and printing a modified version of that variable, and then printing that variable (presumably overwriting the first plot). Are you executing your code one line at a time when troubleshooting? On January 17, 2019 2:32:51 PM PST, David Doyle wrote:

Re: [R] R: estimating genotyping error rate

2019-01-17 Thread Jeff Newmiller
I would say that you may well be asking the wrong question in the right mailing list. Your discipline-specific jargon is impeding communication... you need to know what specific steps you want to take using R. A good reason to start your line of questioning on the Bioconductor forum is that

Re: [R] I can't get seq to behave how I think it should

2019-01-17 Thread Jeff Newmiller
... then you still don't understand. Perhaps you might find [1] helpful. Also, adding a floating point representation of 0.001 to 1.4 for 400 times does not yield the same approximation of 1.8 that you get by directly converting the string "1.8" that you typed into your R interpreter. [1]

Re: [R] Confusion Table

2019-01-16 Thread Jeff Newmiller
ons on the test set. > >tst_pred <- ifelse(predict(model_glm, newdata = default_tst, type = >"response") > 0.5, "Yes", "No") > >tst_tab <- table(predicted = tst_pred, actual = default_tst$default) > >tst_tab > > > >##

Re: [R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
ra. > >This warning appears: >could not find function "fviz_nbclust" > >On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller > wrote: >> >> Concept 1: You don't install functions... you install packages that >have functions in them. There is a function fviz_nbclust

Re: [R] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
Concept 1: You don't install functions... you install packages that have functions in them. There is a function fviz_nbclust in factoextra. Concept 2: Once a package is installed, you do NOT have to install it again, e.g. every time you want to do that analysis. Making the installation part of

Re: [R] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-16 Thread Jeff Newmiller
or be unrelated. You might confirm on this discussion thread whether this function runs okay for you. For future reference, use CRAN packages for examples on this mailing list to clarify that the problem is relevant here. On January 16, 2019 9:48:12 AM PST, Emily Wan wrote: >Hi Jeff - &g

Re: [R] Error with install.packages using R v 3.5.1 and 3.5.2

2019-01-15 Thread Jeff Newmiller
Please ask questions about Bioconductor on the Bioconductor forum [1]. Chances are that you need to re-install Bioconductor because packages are installed in two-digit version-specific libraries... e.g. R 3.4 and R 3.5 do not share packages. [1] https://support.bioconductor.org On January 15,

Re: [R] [R-sig-ME] Calculating F values for lme function

2019-01-15 Thread Jeff Newmiller
:36:22 AM PST, RICARDO ALVARADO BARRANTES wrote: >Thanks for your response, however my understandig of all this >programming is very limited. Is there any source where I can read about >F calculation for those models? > >Thanks for your time > >Ricardo > >El 14-01

Re: [R] loading the xlsx library

2019-01-11 Thread Jeff Newmiller
Failure to read the installation notes for the package. You have to get Java working on your computer. https://cran.r-project.org/web/packages/xlsx/index.html On January 11, 2019 10:40:44 AM PST, Bernard McGarvey wrote: >When I load the library xlsx with the command > > >library("xlsx") > >

Re: [R] Diff'ing 2 strings

2019-01-10 Thread Jeff Newmiller
Just type ?Rdiff it is in the preinstalled packages that come with R. On January 10, 2019 7:35:42 AM PST, Sebastien Bihorel wrote: >From which the diffobj package? > > >From: "Martin Møller Skarbiniks Pedersen" >To: "Sebastien Bihorel" >Cc: "R mailing list" >Sent: Thursday, January 10,

Re: [R] Resampling 1 time series at another set of (known) irregularly spaced times

2019-01-09 Thread Jeff Newmiller
The key to accomplishing this is to clarify how you want to address selecting values between the existing points, but there are many base R functions and packages that address this problem. In general the methods fall into two categories: interpolation and smoothing. Interpolation includes

Re: [R] objects are masked _by_ '.GlobalEnv'

2019-01-08 Thread Jeff Newmiller
There is a mailing list for questions about packages... see the Posting Guide. On January 8, 2019 11:48:37 AM PST, Troels Ring wrote: >Dear friends - this is really a question I'm sorry about since it >doesn't >follow the requirements. I have made a R package via RStudio and it >causes >problems

Re: [R] External validation for a hurdle model (pscl)

2019-01-08 Thread Jeff Newmiller
That said, the gist of the OP's outline is correct, and the main reason to look elsewhere is to get more thorough advice on what statistical concerns should be addressed than would be on topic here. One comment: reviewing plots of differences versus various independent variables for systematic

Re: [R] Question

2019-01-08 Thread Jeff Newmiller
Er, just keep it simple, Marc... give one option: library(lattice) If you _ever_ use require() without acting upon the return value then you are setting yourself or someone else up for confusing missing objects errors someday for no good reason. This _isn't_ just personal preference... by

Re: [R] Merge the data from multiple text files

2019-01-07 Thread Jeff Newmiller
I think it is rather presumptuous of you to think that anyone is going to write an expression optimizer for some unspecified language on the R-help mailing list. I am sure that such tasks can be handled in R, but it is non-trivial and the background needed would be very off-topic here. On

Re: [R] error in plotting model from kernlab

2019-01-07 Thread Jeff Newmiller
a) When re-posting a question, whether on the same or different forums, it is best practice (netiquette) to link to or reply to the earlier question. [1] b) Note the guidance in the Posting Guide: For questions about functions in standard packages distributed with R (see the FAQ Add-on

Re: [R] Need help for logical expression

2019-01-06 Thread Jeff Newmiller
mmented, minimal, self-contained, reproducible code. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research E

Re: [R] Mailinglist

2019-01-06 Thread Jeff Newmiller
gainst the code for SMS or call >(which I assume are those 3000+ numbers). You can take the differences >in what look like POSIX time values between successive TRUE and FALSE >screen values to get the duration of screen activity and it looks like >participant activity is recorded at regular in

Re: [R] Mailinglist

2019-01-05 Thread Jeff Newmiller
Not really. This is R-help, not R-do-my-work-for-me. You need to make enough progress in doing your work that you can ask a focused question about how to do some step of your work in R before your query will be answerable on this mailing list. Once you have started your work you will have some

Re: [R] Accessing Data Frame

2019-01-03 Thread Jeff Newmiller
[!rownames(deck) %in% row.names(topCard),] > >Is it recommended/safe/good practice to work on items using the item >names? > >Benoit > >Jeff Newmiller a écrit : > >>> In my programmer's head, something similar to this should "work": >... >>>

Re: [R] Accessing Data Frame

2019-01-03 Thread Jeff Newmiller
You would be better served to reference SQL semantics (relational identity) than Network database semantics (object identifiers) for understanding data frames. The row in `aCard` is not the same as the row in `deck`, and you should not construct your algorithms based on individual rows but

Re: [R] Accessing Data Frame

2019-01-03 Thread Jeff Newmiller
>In my programmer's head, something similar to this should "work": ... > deck[aCard] There are some people who agree with you... see the data.table package, which can be made to behave like this. Keep in mind that the aCard data frame in general may have a different set of column names or more

Re: [R] Function for displaying arbitrary text as in 'help'.

2019-01-02 Thread Jeff Newmiller
You can probably cobble together something, but spitting large chunks of information at users when the program wants to is bad design. It would be better to make a vignette or help file in a package and put the associated code from which you had been planning to spit out that text. On January

Re: [R] Proposed changes to the R Language

2018-12-29 Thread Jeff Newmiller
hewitt wrote: >Hi Jeff, > >The suggested language looks like it is shifting to some stricter >programming idioms such as defining object's data structure. this video >was shoot in 2017 so I'm not sure if these changes have been put on the >

Re: [R] Regression analysis result compare

2018-12-28 Thread Jeff Newmiller
You have applied to an inappropriate forum using an inappropriate communication format for your question. You should read the Posting Guide to fill in your misunderstanding for future use of this from, but more immediately you should check out the CrossValidated web site for help regarding how

Re: [R] Proposed changes to the R Language

2018-12-28 Thread Jeff Newmiller
I have no idea. But I hope not... that sounds like a different tool than R, just as C++ is a different tool than C. On December 27, 2018 4:36:42 PM PST, "Angus C Hewitt (DHHS)" wrote: >Hi Team, > >Please advise if there are any plans in the pipeline for change the R >language to "B" as

Re: [R] Long input lines in R.exe

2018-12-26 Thread Jeff Newmiller
No. This is a limitation of CMD that R is not designed to work around. On December 26, 2018 8:47:44 AM PST, RK wrote: >Hi, > >When I run R.exe (or Rterm.exe) from cmd.exe and enter in a long input >line, e.g. >

Re: [R] Fwd: UPDATE

2018-12-26 Thread Jeff Newmiller
in your file. On December 26, 2018 7:38:16 PM PST, Spencer Brackett wrote: >So even if I imported the file form ICGC to my desktop as an excel >file, >and can view and saved the data as such, it is still a TSV? > >On Wed, Dec 26, 2018 at 10:35 PM Jeff Newmiller > >wrote: > >

Re: [R] Fwd: UPDATE

2018-12-26 Thread Jeff Newmiller
CSV and TSV are not Excel files. Yes, I know Excel will open them, but that does not make them Excel files. Read a TSV file with read.table or read.csv, setting the sep argument to "\t". On December 26, 2018 7:26:35 PM PST, Spencer Brackett wrote: >I tried importing the file without preview

Re: [R] Retrievable results in a procedure

2018-12-25 Thread Jeff Newmiller
You can use `capture.output`, but a far, far better solution is to remove the output statements from your computation functions entirely and let the caller decide whether to print the results. You can, for example, add a `debug` parameter to the function, and if true it can return a list of as

Re: [R] Issues with R3.5.2

2018-12-24 Thread Jeff Newmiller
m misunderstanding what you mean by the >R3.5 >personal package library? Thanks again > >On Mon, Dec 24, 2018 at 4:28 PM Jeff Newmiller > >wrote: > >> >> >> On December 24, 2018 11:14:40 AM PST, Janh Anni >> wrote: >> >Hello Jeff, Martin, >

Re: [R] Issues with R3.5.2

2018-12-24 Thread Jeff Newmiller
On December 24, 2018 11:14:40 AM PST, Janh Anni wrote: >Hello Jeff, Martin, > >I deleted 3.5.2 as suggested and tried 3.5.1 but still had the same >problems. I still couldn't use read.table to load a data file and >still >had an error message when I tried to install a pack

Re: [R] Random seed

2018-12-23 Thread Jeff Newmiller
] ?Random (https://stat.ethz.ch/R-manual/R-devel/library/base/html/Random.html) On December 22, 2018 8:09:42 PM PST, Jeff Newmiller wrote: >It doesn't matter. The whole point is to make the pseudo-random >sequence repeatable... unless you have a specific reason to avoid >repeatability. >

Re: [R] Problems with library(survival)

2018-12-23 Thread Jeff Newmiller
It means that one of the packages installed during R installation (lattice) is damaged. You should probably re-install R. On December 23, 2018 12:01:12 PM PST, Medic wrote: >> install.packages("survival") >package ‘survival’ successfully unpacked and MD5 sums checked >> library(survival)

Re: [R] Issues with R3.5.2

2018-12-22 Thread Jeff Newmiller
sue only came up after I installed R3.5.2. Never had any >problems >with previous installations. So it is likely a bug in the current >version. Any suggestions what to do now? > >On Sat, Dec 22, 2018 at 11:06 PM Jeff Newmiller > >wrote: > >> That normally only occ

Re: [R] Random seed

2018-12-22 Thread Jeff Newmiller
It doesn't matter. The whole point is to make the pseudo-random sequence repeatable... unless you have a specific reason to avoid repeatability. On December 22, 2018 5:33:39 PM PST, Steven Yen wrote: >I have known from the old days to set a random seed of a LARGE ODD >NUMBER. Now I read

Re: [R] Issues with R3.5.2

2018-12-22 Thread Jeff Newmiller
R package library... always use a personal library. On December 22, 2018 6:01:44 PM PST, Janh Anni wrote: >Hi Jeff, > >No, during the installation, there was not an option to Run as >Administration. But *after *installation, I found that if I selected >Run >as Administr

Re: [R] Issues with R3.5.2

2018-12-22 Thread Jeff Newmiller
Did you by any chance use Run As Administrator to install R? If so then you need to uninstall it and delete all files created by it (e.g. Documents/R/win-lib/3.5/) and re-install using UAC as prompted. On December 22, 2018 5:10:27 PM PST, Janh Anni wrote: >Dear R Experts, > >I use Windows 10

Re: [R] Printing with cat in a procedure

2018-12-22 Thread Jeff Newmiller
Try using print instead of cat [1], and please read about what the arguments are in the help file [2][3] for any function you are using before posting a question. [1] https://stackoverflow.com/questions/31843662/what-is-the-difference-between-cat-and-print [2] ?cat [3] ?print On December 22,

Re: [R] Problem with system() and source on linux

2018-12-20 Thread Jeff Newmiller
Read the man page for bash... source is built-in to the shell interpreter. You should invoke a single shell instance that first sources the profile and then executes the program... but this has nothing to do with R... this would be true for any program invoking an external program on a

Re: [R] Plotting rgb proportions in R

2018-12-18 Thread Jeff Newmiller
I can't figure out what message you are hoping to convey in your plot from your posting... what are you comparing to what? Comments like "I've run into different examples of people using vegan (an analysis package with some diagnostic display functionality) or grDevices (a package supporting

Re: [R] AUC/Volume under the surface

2018-12-17 Thread Jeff Newmiller
You need to grasp two concepts: 1) Models in R conventionally have predict methods. To plot your model, predict the dependent variable based on the model object and a grid of your independent variable(s). Whether you have interactions or logistic regression shouldn't be relevant to getting a

Re: [R] Functional data anlysis for unequal length and unequal width time series

2018-12-17 Thread Jeff Newmiller
You will learn something useful if you search for "rolling join". The zoo package can handle this, as can the data.table package (read the vignette). Your decision to pad with NA at the end was ill-considered... the first point of your first series is between the first two points of your second

Re: [R] error = FALSE causes knit2wp to throw duplicate label error

2018-12-16 Thread Jeff Newmiller
This seems a bit deep into knitr for R-help... you might have better luck on StackExchange. I also suggest that posting an incomplete example is usually the kiss of death for getting constructive assistance online. FWIW my guess is that executing knitr from within an Rmarkdown document is a

Re: [R] Need help with R studio

2018-12-14 Thread Jeff Newmiller
Looks fine to me, though you seem to be confused between what R is (on topic in this mailing list) and what RStudio is (a fine software package that relies on R but is not really on topic here). Do find the link in the footer below about posting in R-help and read it before posting again. On

Re: [R] R and factorytalk historian

2018-12-11 Thread Jeff Newmiller
R supports a wide range of data transfer methods, Petr... you know for example that if you export data from Excel in CSV format then you can import it to R, yet this solution does not satisfy all users in all cases. What expectations do you have? Why don't you do some legwork and identify what

Re: [R] how to keep colnames of matrix when put it into a data frame

2018-12-09 Thread Jeff Newmiller
Read ?data.frame In particular, notice the check.names argument. On December 9, 2018 7:11:52 AM PST, Michael Dewey wrote: >Dear Jinsong > >Try cbind(x = 1:3, mat) >and see if that helps > >Michael > >On 09/12/2018 15:05, Jinsong Zhao wrote: >> Hi there, >> >> In the following mini-example, I

Re: [R] General information

2018-12-08 Thread Jeff Newmiller
Please use a search engine, as all of the answers to these questions are already written down online, and this mailing list is primarily handled by volunteers who would have to do your searching for you to answer your questions. On December 8, 2018 2:46:32 AM PST, ghada mhedat wrote: >Hello >

Re: [R] sample (randomly select) from successive days

2018-12-07 Thread Jeff Newmiller
myfirst <- sample( seq.int( nrow(myframe)-1 ), 1 ) mysample <- myframe[seq( myfirst, myfirst+1),] mysample On December 7, 2018 2:24:11 AM PST, Dagmar Cimiotti wrote: >Hi Jim and everyone else, > >Mhm, no this is not what I am looking for. I think in your way I would >randomly sample two values

Re: [R] Bug (?): reading binary files in Windows 10

2018-12-06 Thread Jeff Newmiller
AFAIK this receiver-side responsibility to specify the text/binary status of the file is particularly a problem with the "ftp://; protocol because it does not use MIME file encoding (which "http://; uses). MIME allows the sending end of the connection to communicate whether the file is text or

Re: [R] sustraction of two vectors of matrix

2018-12-05 Thread Jeff Newmiller
or with no loops and no preallocation: bb <- aa[ , 2:5 ] - aa[ , 1:4 ] On December 5, 2018 8:51:16 AM PST, Rui Barradas wrote: >Hello, > >1) You don't need matrix(outer(etc)), outer already returns a matrix. >2) You need to create bb first. > >aa <- outer(0:3, 0:4, function(x,y) x + y*2) > >bb

Re: [R] Random projection

2018-12-04 Thread Jeff Newmiller
Your multiplication description sounds more like matrix multiplication than scalar multiplication. R supports matrix multiplication with the %*% operator. I didn't follow the rest of your description... are you doing a homework assignment? There is a no homework policy on this list... On

Re: [R] (no subject)

2018-12-02 Thread Jeff Newmiller
It is possible that this is not an RStudio-specific issue in spite of the initial phrasing. Mahboobe: If when you use Rgui (Windows) or R.app (Mac) or plain R at the command line (any OS) you still have problems, then you may need to ask for help here or in R-sig-mac or R-sig-debian or

Re: [R] Applying a certain formula to a repeated sample data

2018-11-27 Thread Jeff Newmiller
hz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE an

Re: [R] TrendRaster function

2018-11-26 Thread Jeff Newmiller
a) You had to go out of your way to even install this package... it is lonly available on R-forge. This kind of question seems likely to require support from the package author. (Use the"maintainer" function to identify the author.) b) You may find a similar functionality in a CRAN package. Try

Re: [R] CenReg download

2018-11-26 Thread Jeff Newmiller
http://lmgtfy.com/?q=cenReg Notice that you will need to use the install.packages function to install the package, and then the library function to attach it to the function search path. On November 26, 2018 8:10:44 AM PST, Olofinsao Tosin wrote: >Greetings. > >Please I need cenReg function

Re: [R] detecting measurement of specific id in column in R

2018-11-22 Thread Jeff Newmiller
You hope... but no... not really. You need to enhance your question with a (minimal) example of the data just after importing into R, and another example of what you think the result should look like. Also, you should provide your current best guess at what a calculation would include expressed

Re: [R] Speed of RCppEigen Cholesky decomposition on sparse matrix

2018-11-21 Thread Jeff Newmiller
I believe you have the wrong list. (Read the Posting Guide... you seem to have R under control.) Try Rcpp-devel. FWIW You probably need to spend some time with a C++ profiler... any language can be unintentionally mis-used, and you first need to identify whether your calling code is

Re: [R] Help with factor column replacement value issue

2018-11-16 Thread Jeff Newmiller
My suggestion is to avoid converting the column to a factor until it is cleaned up the way you want it. There is also the forcats package, but I still prefer to work with character data for cleaning. The stringsAsFactors=FALSE argument to read.table and friends helps with this. On November 16,

Re: [R] very slow "memoise"

2018-11-15 Thread Jeff Newmiller
Yes, you have misunderstood what memoise is for. First, it is for when you call your function with the same inputs frequently as part of your calling-level algorithm. For your iterative calculation you would have a stuck (cycling) process if the same value of current were to be revisited...

Re: [R] Read

2018-11-09 Thread Jeff Newmiller
roject.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] list contingency tables

2018-11-09 Thread Jeff Newmiller
Don't give up on for loops entirely... some of the largest time savings in optimizing loops are achieved by managing memory effectively. [1] [1] https://www.r-bloggers.com/r-tip-use-vectormode-list-to-pre-allocate-lists On November 8, 2018 8:05:39 PM PST, li li wrote: >Hi all, > I am trying

Re: [R] Identify row indices corresponding to each distinct row of a matrix

2018-11-08 Thread Jeff Newmiller
15 >6 6 14 >7 4 12 >9 8 16 >> >> i <- 1 >> which(C[,1]==T[i,1]& C[,2]==T[i,2]) >[1] 1 13 15 > > >Bert Gunter 于2018年11月8日周四 上午10:43写道: > >> Yes -- much better than mine. I didn't know about the MARGIN argument >of >> duplicated(). &

Re: [R] Identify row indices corresponding to each distinct row of a matrix

2018-11-07 Thread Jeff Newmiller
Perhaps which( ! duplicated( m, MARGIN=1 ) ) ? (untested) On November 7, 2018 9:20:57 PM PST, Bert Gunter wrote: >A mess -- due to your continued use of html formatting. > >But something like this may do what you want (hard to tell with the >mess): > >> m <- matrix(1:16,nrow=8)[rep(1:8,2),] >>

Re: [R] Optimization with Parallel Processing Functions/Packages

2018-11-07 Thread Jeff Newmiller
This is highly problem dependent... and you appear to already know the answer. Note that some differential evolution solution approaches may benefit from parallelizing evaluation of generations since within that sub-problem the optimization dependencies don't apply. A theoretical discussion

Re: [R] Importing JSON Files

2018-11-06 Thread Jeff Reichman
Kimmo Didn't perform exactly how I wanted but got me looking in the right area. Thank you Jeff -Original Message- From: R-help On Behalf Of K. Elo Sent: Monday, November 5, 2018 1:14 PM To: r-help@r-project.org Subject: Re: [R] Importing JSON Files Hi! Have you tried to use 'fromJSON

<    5   6   7   8   9   10   11   12   13   14   >