Re: [R] [External] finding nearest zip codes

2020-08-04 Thread Jeff Newmiller
If you fail to force the zip code data to be read in as character data then you will have problems. Your code does not use the colClasses argument or the stringsAsFactors=FALSE argument (needed if you are using a version of R earlier than 4.x). Richard was suggesting that you use the str functio

Re: [R] [External] finding nearest zip codes

2020-08-04 Thread Debasmita Sur
Hi Richard, I have not considered the 4 digit zip codes, I have taken only 5 digits. I have attached two folders, in the 'air' folder I have some specific zip codes and in output I got proper results, whereas in the 'par' folder I got 'NA's in the minimum distance column. Actually, the problem was

[R] Fwd: defining group colours in a call to rda

2020-08-04 Thread Andrew Halford
-- Forwarded message - From: Abby Spurdle Date: Wed, Aug 5, 2020 at 3:07 PM Subject: Re: [R] defining group colours in a call to rda To: Andrew Halford Hi Andrew, Perhaps you want this: cols <- rep_len (c ("red", "green", "blue", "aquamarine", "magenta"), 9) cols Or t

Re: [R] finding nearest zip codes

2020-08-04 Thread Bert Gunter
In addition to Rich's advice... as always, have you searched?! e.g. on "zip code distances" or similar at rseek.org. This appears to have been asked before and there are tools available. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into i

Re: [R] [External] finding nearest zip codes

2020-08-04 Thread Richard M. Heiberger
verify that you actually have five-digit zip codes stored as characters. New Jersey and Massachusetts have zero as the first digit. When these codes are saved as numbers, they become four-digit codes and will probably cause errors. For example Cambridge, Mass is '02138', and would be reported as 2

[R] finding nearest zip codes

2020-08-04 Thread Debasmita Sur
Dear R-experts, I have two lists of US zip codes and want to pick the nearest zip code from second list against my first list.e.g.30043 (from second list) is closest to the zip code 30094 (from first list).So,it should come against 30094.The code should compare the distance from each zip and pick t

Re: [R] Arrange data

2020-08-04 Thread Rui Barradas
Hello, Please keep cc-ing the list R-help is threaded and questions and answers might be of help to others in the future. As for the question, see if the following code does what you want. First, create a logical index i of the months between 7 and 3 and use that index to subset the original

Re: [R] defining group colours in a call to rda

2020-08-04 Thread Abby Spurdle
Hi, Your example is not reproducible. However, I suspect that the following is the problem: c("red","green","blue","aquamarine","magenta")[MI_fish_all.mrt$where] Here's my version: where = c (3, 3, 8, 6, 6, 9, 5, 5, 9, 3, 8, 6, 9, 6, 5, 9, 5, 3, 8, 6, 9, 6, 5, 9, 5, 3, 3, 8, 6, 6, 9, 5, 5, 9, 6

Re: [R] Mathematical working procedure of duplicated() function in r

2020-08-04 Thread Greg Snow
Rui pointed out that you can examine the source yourself. FAQ 7.40 has a link to an article with detail on finding and examining the source code. A general algorithm for checking for duplicates follows (I have not examined to R source code to see if they use something more clever). Create an emp

Re: [R] Mathematical working procedure of duplicated() function in r

2020-08-04 Thread Rui Barradas
Hello, R is open source, you can see exactly what is the internal working of any function. You can have access to the code by typing the function's name without parenthesis at an R command line. > duplicated function (x, incomparables = FALSE, ...) UseMethod("duplicated") Now, this tells u

Re: [R] confidence intervals for the difference between group means

2020-08-04 Thread Prof. Dr. Matthias Kohl
you could try: library(MKinfer) meanDiffCI(a, b, boot = TRUE) Best Matthias Am 04.08.20 um 16:08 schrieb varin sacha via R-help: Dear R-experts, Using the bootES package I can easily calculate the bootstrap confidence intervals of the means like in the toy example here below. Now, I am looki

[R] confidence intervals for the difference between group means

2020-08-04 Thread varin sacha via R-help
Dear R-experts, Using the bootES package I can easily calculate the bootstrap confidence intervals of the means like in the toy example here below. Now, I am looking for the confidence intervals for the difference between group means. In my case, the point estimate of the mean difference is 64.

Re: [R] Double MAD with R

2020-08-04 Thread varin sacha via R-help
Dear Rui, Many thanks for your response. Best, SV Le lundi 3 août 2020 à 16:54:35 UTC+2, Rui Barradas a écrit : Hello, No, there isn't a built-in that I know of. Here is one: double.mad <- function(x, include.right = FALSE, na.rm = FALSE){   if(na.rm) x <- x[!is.na(x)]   m <-

[R] Mathematical working procedure of duplicated() function in r

2020-08-04 Thread K Purna Prakash
Dear Sir(s), I request you to provide the detailed* internal mathematical working mechanism of the following function *for better understanding. *x[duplicated(x) | duplicated(x, fromLast=TRUE), ]* I am having some confusion in understanding how duplicates are being identified when thousands of reco

Re: [R] hist from a list

2020-08-04 Thread Pedro páramo
Hi Rasmus, Josh and Rui, First of all many thanks in advance about your help. The first thig is sometimes you say " you are posting in HTML and that makes the post unreadable as this is a plain text list" how can I put the code in the correct way, not html (attaching in txt?) The second about th

[R] defining group colours in a call to rda

2020-08-04 Thread Andrew Halford
Hi, I've been trying to use the output on group membership of the final leaves in a MRT analysis to define my own colours, however I am not getting the result I'm after. Here is the code fish.pca <-rda(fish_all.hel,scale=TRUE) fish.site <- scores(fish.pca,display="sites",scaling=3) fish.spp <- sc

Re: [R] Arrange data

2020-08-04 Thread Jim Lemon
Your problem is in the subset operation. You have asked for a value of month greater or equal to 7 and less than or equal to 6. You probably got an error message that told you that the data were of length zero or something similar. If you check the result of that statement: > mddat$month >= 7 & md