similar to: minimum distance between line segments

Displaying 20 results from an estimated 11000 matches similar to: "minimum distance between line segments"

2011 Feb 16
2
distance between consecutive points
Dear R users, I have two coloumns of data, say x and y, referring to a list of points in 2D space. I am trying to develop a code that will give me the distances (using Pythagoras) between consecutive points (xi,yi) and (xi+1,yi+1). So far I have come up with the following: for (i in 1:length(x)) d<-sqrt((x[i+1]-x[i])^2+(y[i+1]-y[i])^2) For example, if I use the two points (note, I have
2011 Feb 21
3
multiple plots using a loop
Dear R users, I am trying to write myself a loop in order to produce a set of 20 length frequency plots each pertaining to a factor level. I would like each of these plots to be available on the same figure, so I have used par(mfrow = c(4, 5)). However, when I run my loop below, it produces 20 plots for each factor level and only displays the last factor levels LF plots. I'm fairly new to
2011 Mar 08
3
allocating factor levels
Dear R users, I am working on allocating the rows within a dataframe into some factor levels.Consider the following dataframe: Start.action Start.time 1 Start.setting 2010-12-30 17:58:00 2 Start.setting 2010-12-30 18:40:00 3 Start.setting 2010-12-31 22:39:00 4 Start.setting 2010-12-31 23:24:00 5
2009 Nov 20
3
help me avoid nested for() loops!
Hi R folks, I have a massive array (object name "points") in the following form [,1] [,2] [1,] 1369 22 [2,] 1370 22 [3,] 1368 23 [4,] 1369 23 [5,] 1370 23 [6,] 1371 23 (10080 rows truncated) These represent pixel coordinates of interest in a jpeg image. I need to find the distance from each point to all other points of interest. The only way I can see to do this
2011 Mar 24
1
extracting file names
Dear R users, I am trying to figure out a way to extract the original file name of a .DAT (e.g., IC48.DAT) file imported into R using the file.choose() function, i.e., dat <- read.table(file.choose(), header = FALSE) The reason I would like to do this is to use that file name to name an output file, thus if I had the file name, e.g., file.name <- IC48 # then I do a bunch of stuff to dat
2017 Jun 18
2
About error bars on barplots
Hi R users, I have a question about adding uncertainty bars to stacked bar plots. DF: year A B C Amin Amax Bmin Bmax Cmin Cmax 2009 40 45 15 30 61 23 56 14 17 2010 36 41 23 26 54 22 51 22 24 I use the code below: DF.refm = melt(subset(DF[,c(1:4)]),id.vars='year',variable_name='Legend') fig1 =
2017 Jun 18
0
[FORGED] About error bars on barplots
On 18/06/17 12:10, lily li wrote: > Hi R users, > > I have a question about adding uncertainty bars to stacked bar plots. > > DF: > year A B C Amin Amax Bmin Bmax Cmin Cmax > 2009 40 45 15 30 61 23 56 14 17 > 2010 36 41 23 26 54 22 51 22 24 > > I use the code below: > >
2009 Mar 12
3
avoiding termination of nls given convergence failure
Hello. I have a script in which I repeatedly fit a nonlinear regression to a series of data sets using nls and the port algorithm from within a loop. The general structure of the loop is: for(i in 1:n){ … extract relevant vectors of dependent and independent variables … … estimate starting values for Amax and Q.LCP…
2011 Oct 24
1
nonlinear model
Hello, I am trying to do a nonlinear model using the "nls" command in R software. The data I am using is as follows: A<-c(7.132000,8.668667,9.880667,8.168000,10.863333,10.381333,11.059333,7.589333,4.716667,4.268667,7.265333,10.309333,8.456667,13.359333,8.624000,13.571333,12.523333,4.084667 ,NaN,NaN)
2006 Jan 06
3
Installing Java 1.4.2
For scalix on Centos the Scalix forum provides instructions for convincing Scalix that Centos is Redhat: http://www.scalix.com/community/viewtopic.php?t=516&highlight=centos I am up to the point of getting Java JDK1.4.2 installed. I did a: yum list|grep "java" and got: gcc-java.i386 3.4.4-2 installed java-1.4.2-gcj-compat.noarch
2019 Feb 25
7
Problem with mdadm, raid1 and automatically adds any disk to raid
Hi. CENTOS 7.6.1810, fresh install - use this as a base to create/upgrade new/old machines. I was trying to setup two disks as a RAID1 array, using these lines mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1 mdadm --create --verbose /dev/md1 --level=0 --raid-devices=2 /dev/sdb2 /dev/sdc2 mdadm --create --verbose /dev/md2 --level=0 --raid-devices=2
1999 Aug 26
1
error bars on barplots
Hello again I'm trying to put error bars onto a barplot. I've tried something that Bill Simpson suggested a while ago, ie: x<-c(1,2,3,4,5) y<-c(1.1, 2.3, 3.0, 3.9, 5.1) ucl<-c(1.3, 2.4, 3.5, 4.1, 5.3) lcl<-c(.9, 1.8, 2.7, 3.8, 5.0) plot(x,y, ylim=range(c(lcl,ucl))) arrows(x,ucl,x,lcl,length=.05,angle=90,code=3) #or segments(x,ucl,x,lcl) but I can't get it to work on a
2009 May 06
6
by-group processing
Given a dataframe like > data ID Type N 1 45900 A 1 2 45900 B 2 3 45900 C 3 4 45900 D 4 5 45900 E 5 6 45900 F 6 7 45900 I 7 8 49270 A 1 9 49270 B 2 10 49270 E 3 18 46550 A 1 19 46550 B 2 20 46550 C 3 21 46550 D 4 22 46550 E 5 23 46550 F 6 24 46550 I 7 > containing an identifier (ID), a
2011 Jul 06
3
finding the intersection of two vectors
Hi, Suppose I have two vectors, not necessarily the same length (in fact, they usually are different lengths): y.1 that has increasing values between 0 and 1; y.2 that has decreasing values between 1.0 and 0. You can picture these as being supply (= y.1) and demand (= y.2) curves from economics. I typically plot these vectors on the same graph against a common x variable, which happens to
2003 Dec 23
1
How can I put error bars on a barplot() ?
Hi all, I am a relatively new R user... trying to put error bars (from SD values) on my data represented with barplot(). But I can't find any function or instruction to do so. Is there an easier way to do this than using segments() as I saw in an example in the R reference manual ? Then, can I define there graphical apparence ? Thanks for help. Regards Olivier BUHARD [[alternative HTML
2011 Apr 07
1
df with max function applied to 6 lags of a variable?!?
Hello everyone! I have a data frame of 136 variables with 270 observations. I would like to create a new data frame such that each element of that data frame contains the maximum value of the 6 prior lags of the initial data frame. So for example, if my original data frame, A, were A1=c(7.72, 7.94, 7.56, 7.54, 0.93, 0.59, 7.21, 8.00, 7.19, 7.57)A2=c(4.27, 3.70, 3.80, 3.67, 3.83, 3.95, 4.02, 2.06,
2005 Aug 18
4
Driver for Powerware 3105 (USB)
I ordered some Powerware 3105 devices for Linux workstations. These devices only have an USB interface. I understood too late that support for Powerware devices is only available for the serial interface. Since the protocols over serial and USB seem to be identical, it was not too difficult to modify the bcmxcp driver to support USB. The new and changed files can be found here:
2008 Oct 01
9
time segments intersection
Hi all, Please, how could I calculate the time that two time segments has in common? Is there any function to perform this calculation? For instance, given four POSIXlt objects... endPeriod<-as.POSIXlt("2008-09-30") startPeriod<-as.POSIXlt("2007-10-01") endProject<-as.POSIXlt("2007-05-31") startProject<-as.POSIXlt("2006-12-01") that limit
2009 Nov 08
3
Obtaining midpoints of class intervals produced by cut and table
Hello list: I am using "cut" and "table" to obtain a frequency table from a numeric sample vector.  The idea is to calculate mean and standard deviation on grouped data.  However, I can't extract the midpoints of the class intervals, which seem to be strings treated as factors.  How do i extract the midpoint? Thanks, jose loreto [[alternative HTML version deleted]]
2009 Oct 02
1
suggest enhancement to segments and arrows to facilitate horizontal and vertical segments
I suggest a simple enhancement to segments() and arrows() to facilitate drawing horizontal and vertical segments -- set default values for the second x and y arguments equal to the first set. This is handy, especially when the expressions for coordinates are long. Compare: Segments: < function (x0, y0, x1 = x0, y1 = y0, col = par("fg"), lty = par("lty"), --- > function