Displaying 16 results from an estimated 16 matches similar to: ""For" loop and "if" question"
2005 Jan 19
1
looking for a basic spatial diff function
Background:
OS: Linux Mandrake 10.1
release: R 2.0.0
editor: GNU Emacs 21.3.2
front-end: ESS 5.2.3
---------------------------------
Colleagues
Is there a function to calculate distances between adjacent latitude/
longitude pairs in a matrix? It is basically a spatial diff() function that
I have in mind.
Data:
long1, lat1
long2, lat2
long3, lat3
looking for: diff(data$long, data$lat)
2008 Sep 12
2
Join data by minimum distance
I am wondering if there is a function which will do a join between 2 data.frames by minimum distance, as it is done in ArcGIS for example. For people who are not familiar with ArcGIS here it is an explanation:
Suppose you have a data.frame with x, y, coordinates called track, and a second data frame with different x, y coordinates and some other attributes called classif. The track data.frame has
2006 Jul 19
5
Model Validation - with a twist
I''m stuck in a catch-22 type problem. I have an insert form for a table
that uses the validation in the model. i.e. When you click submit on the
form and haven''t filled in the required fields then you get the nice
rails error messages saying "field can not be blank". This works fine
until I introduce some more logic.
What I''m trying to do is to validate
2008 Nov 17
2
How to calculate the linear distance between 2 points
Deemed colleagues
I would appreciate your help with a sentence to calculate the linear
distance between 2 geographical points (coordinates in UTM).
In advance thnks for your attention,
--
Ricardo Bandin Llanos
rbandin@udec.cl
Estudiante - Magíster Cs. m. Pesquerías
Universidad de Concepción, Región del Bio-Bio, Chile
Celular: (0056-41) 97949957
[[alternative HTML version deleted]]
2011 Jan 20
1
Generating time progressing line for Google Earth
Dear,
I am trying to visualise a time-progressing line (it's supposed to
represent spread patterns) using brew package and Google Earth.
The idea is to have a function which takes start and end point
geographic coordinates, as well as number of intervals to chop the path
up, and returns the collection of points segmenting this line.
Unfortunately my calculations fail for large distances,
2010 Jul 23
1
Midpoint between coordinates
Dear R users,
I need to find the coordinates for the point (midpoint) located half
way between two pairs of coordinates (lon1,lat1 and lon2,lat2)
assuming a straight line between them. What would be the best way? I
tried to find an answer in the help archives but without success. I
would greatly appreciate any help.
df<- data.frame(lon1=c(-4.568,-4.3980), lat1=c(59.235,56.369),
2007 Apr 29
1
randomForest gives different results for formula call v. x, y methods. Why?
Just out of curiosity, I took the default "iris" example in the RF
helpfile...
but seeing the admonition against using the formula interface for large data
sets, I wanted to play around a bit to see how the various options affected
the output. Found something interesting I couldn't find documentation for...
Just like the example...
> set.seed(12) # to be sure I have
2007 Oct 30
2
calculate spatial distance
Hi,
I have a set of locations defined by longitude and latitude (in degrees),
and want to calculate the spatial (or geographic) distance among all
locations.
I did not find such a function in the spatial-related packages. (I *cannot*
use 'dist', as I have geographic, not cartesian coordinates).
thanks!
Robert
Robert Ptacnik
Norwegian Institute for Water Research (NIVA)
Gaustadall?en 21
2011 Feb 08
0
favorite pattern for adding functionality to an AR?
Do you have a preferred programming pattern for adding functionality to
an ActiveRecord? As an example, say I have some gnarly trig functions
for distance and bearing between pairs of latitude and longitude:
=== file: latlng.rb
module LatLng
def haversine_distance(lat1, lng1, lat2, lng2)
...
end
def bearing(lat1, lng1, lat2, lng2)
...
end
=== EOF
... and I want to mix in
2009 Apr 07
0
Converting a whole dataframe (including attributes) from latin1 to UTF-8
Hi list!
Short version: How do I convert a whole data.frame from latin1
encoding to utf8?
I get SPSS files with latin1 encoding. My OS is GNU/Linux and the
locale sv_SE.utf8, and I normally interface R with Emacs/ESS. I have
used the following hack to convert a data.frame in latin1 to utf8:
> Sys.setlocale(category = "LC_ALL", locale = "sv_SE.iso88591")
> foo <-
2005 Jul 12
2
unix charset = LOCALE
Andrew Bartlett said once that 'unix charset = LOCALE' means to force samba to read 'LANG=' from environment.
>echo $LANG
>en_US
>cat /etc/sysconfig/i18n
>LANG="en_US.UTF-8"
>SUPPORTED="en_US.UTF-8:en_US:en"
>SYSFONT="lat1-16"
When i restart smbd/nmbd all my files inside all shares change their names. Its looks an charset mis-match
2005 Mar 04
1
Unicode problem.
Hi!
Here is my isolinux.cfg. It's slackware based.
======================
default Kernels/bare.i/bzImage initrd=initrd.img load_ramdisk=1
prompt_ramdisk=0 ramdisk_size=8192 rw root=/dev/ram ZILIX_KERNEL=bare.i
prompt 1
timeout 1200
font lat1-16.psfu
display mensagem.msg
F1 mensagem.msg
F2 opcoes.msg
F3 help.msg
label linux
kernel Kernels/bare.i/bzImage
append -
label adaptec.s
kernel
2005 Jul 11
3
charset issue
Hi,
When i restart smbd/nmbd, all the files inside all shares change their
names.
All the files are affected specially accent portuguese brazilian files.
File names become a mess in whole samba server.
1) Has anyone seen this kind of samba server behavior?
2) Im using samba 3.0.4, is there a recognized bug? , if i change to
latest version will this issue be solved?
Any suggestions are highly
2009 Nov 15
1
R crashing
Hello,
This is what I am trying to do: I wrote a little function that takes
addresses (coordinates) as input, and returns the road distance between
every two points using Google Maps. Catch is, there are 2000 addresses, so I
have to get around 2x10^6 addresses. On my first go, this is what I did:
#########################################
getRoadDist = function(X,complete=F){ # X must be a
2012 Dec 17
5
save to file
Hi,
What's the equivalent of "Save to File" from the R console File menu on an R routine? Just trying
to capture the whole R console into a text file when my code fails.
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx
[[alternative HTML version deleted]]
2007 Aug 23
20
Eliminating bad tests from SuperRedCloth
Hi, all. I haven''t felt at liberty to go axing test cases, but some
of the 33 that are failing now are ones I don''t think we want to pass?
cruft coming from Markdown or made up to fill a gap some years ago.
I''d like to float the proposition that we make Super (and thus
RedCloth 4) behave as identically as possible to Textile2 as working
on