Displaying 20 results from an estimated 10000 matches similar to: "ActiveRecord and attributes returned"
2006 Jun 18
3
ActiveRecord Help - Not finding Data
Hello,
I''m farily new to RoR and am having a problem trying to retrieve data
from my database. Here is the code from my controller:
def index
zip = params["zip"]
@zip1 = Zipcode.find(:first, :conditions => ["zip = ?", zip])
lat = @zip1.latitude.to_f
long = @zip1.longitude.to_f
radius = 50
@bookstores = Bookstore.find_by_sql ["SELECT * FROM
2006 May 08
0
ZipCode Search
I''ve looked through the messages regarding implementing a ZipCode search
and I have a few questions to make sure I have my head wrapped around
this.
Here''s what I have. I have a database table called zipcodes with the
following info (for example)
30310 Atlanta GA 33.727807 -84.41983 -5 1
That''s zip, city, state, latitude, longitude, timezone, and dst.
So when a
2009 Jun 23
2
syntax error, unexpected tINTEGER, expecting $end
Please help me solve the following error message:
syntax error, unexpected tINTEGER, expecting $end
I have this model:
Code:
1. class GeoDatum < ActiveRecord::Base
2. end
The database contains the table geo_data, which contains the zip_code
column, filled with zip codes. I get the above error when searching
for a zip code and the zip code exists in the table. Here is the
2013 Jan 21
2
Regex for ^ (the caret symbol)?
Hello R-helpers,
I am trying to search for string that includes the caret symbol, using the
following code:
grepl("latitude^2",temp)
And R doesn't like that. It gives me:
> temp<-c("latitude^2","latitude and latitude^2","longitude^2","longitude
and longitude^2")
> temp
[1] "latitude^2" "latitude and
2010 Nov 01
0
function: colvolve
Hi list,
I have a problem to solve which I believe I shoudl use the convolve to solve
it, but I could not figure out how to do it.
I got mydata, which is a dataframe which has 7 locations, each location has
a longitude,latitude and a value.
considering a step of 0.5 degree for longitudes and latitudes, I got 15
points for longitude and 15 points for latitude. Then
I created a grid, mygrid, which
2009 Apr 08
2
Reshape - strange outputs
Dear R Users,
I am using the reshape package to reformat gridded data into column format using the code shown below. However, when I display the resulting object, a single column is fomed (instead of three) and all the latitude values (which should be in either column one or two) are collected at the bottom. Also, the NA values aren't removed, despite this being requested in the code.
Code:
2009 Mar 06
1
help to use ppp in spatial analysis
Hi,
i am using spatstat package for spatial data analysis and now i have a problem to create a point pattern. The points are in file "points.txt" (first column for Latitude and second column for Longitude ) and I imported them and separated each columns in two arrays x and y. If I plots x and y ( e.g plot(x,y) ) the result appears in square area without problems and the scale is
2011 Oct 17
0
geoXY
Hi Everyone,
I am new to R Language and was wondering if someone could help me convert my latitude-longitude coordinates to cartesian coordiantes using geoXY() from SoDA package? I have been uploading my coordinates from a text file into R (they originate as a dataframe) and them converting them to a matrix using the data.matrix() function. But I think I'm running into trouble when I try to
2002 Mar 10
1
lattice library: xyplot and polygons
Dear R-Helpers,
Is there a way to draw shaded (filled) polygons in panel graphs produced
by xyplot ? I made different trials (see below) with polygon() and
grid.polygon() but polygons are not drawn (probably for the same reason
that prevents the use of lines, points, etc. in xyplot panels).
Thanks in advance,
Renaud
> Water
id label longitude latitude
515 21 Zone inondable
2012 Feb 23
4
saving all data in r object
I have 100 data files, which contains very huge data sets of location
details ( e.g latitude, longitude, time, temp)
Now I would like to save the all data of these 100 files in r object, so I
can reload data any time.
* Every file has different length of data
latitude <- NULL
longitude <- NULL
time <- NULL
temp <- NULL
for ( i in 1:100) {
data<-
2008 Jul 15
3
Melt (reshape) question
Dear all,
I
have a grid of 720 columns by 360 rows of global population density
values, and hope to convert this to column format using the 'melt' command in the 'reshape' package. I'm not receiving
any errors as such, but when the code has finished running, my output
looks like this:
> head(PopDens.long)
Latitude Longitude PopDensity
1 -84.75 V1 0
2
2011 Sep 07
3
Editing the variables attributes section in the netCDF header of netCDF files created using the package ncdf.
Hi,
I am using the package ncdf to create netCDF files and I want to mimic the the header of an exiting netCDF file created outside of R. Below is what the existing header looks like (part of it that is different):
netcdf ccd1984_05_08 {
dimensions:
lat = 1974 ;
lon = 1894 ;
time = UNLIMITED ; // (1 currently)
variables:
int time(time) ;
2009 May 01
1
Problems with 'valid columns' when using merge
Dear all,
I am trying to use 'merge' within a loop, however, I receive an error relating to the 'by' argument of the command, as follows:
> merge_year <- 1986
>
> for (i in 1:10) { # Number of file pairs
+ assign(paste("merged_arunfek_", merge_year, sep=""), merge(x=paste("arunoff_",start_arunoff, sep=""),
2002 Oct 02
6
help to make a map on R
Hi all,
I need a little help for construct an state's map on R.
The first problem is to get the data.
I have a datafile of longitude and latitude in the follow format:
trajectory latitude longtude
T -22.045618 -51.287056
T -22.067078 -51.265888
T -22.067039 -51.207249
T -22.059690 -48.089695
T -22.075529 -48.074608
T -22.072460 -48.044472
T -22.062767 -48.298473
T -22.077349
2012 Sep 14
2
plotting points on a map, assigning vectors to values from dataset
Dear everyone, as a newbie I fear I have made an easy mistake and am just too
blind to see it. Can anyone help me seeing the (possibly) obvious?
I have a command that creates a map of South America. In a separate
txt-file I stored data about latitude and longitude of languages, and in a
third column values that differ from language to language. The command
should read that file and assign the
2012 Jun 05
2
Converiting longitude/latitude to utm
Dear all,
I have been trying to convert coordinates from longitude/latitude to utm
but I got an error. As soon as the longitude coordinate is greater than 90,
I get the folloowing error message: "error in pj_transform: latitude or
longitude exceeded limits"
Here is what I did:
SP<-SpatialPoints(cbind(126.59,-14.30),proj4string=CRS("+proj=longlat"))
2009 Aug 25
2
latitude and longitude distribution
Good day to you all,
I have lightning data containing date, time, latitude and longitude. I hope
that distribution of latitude and longitude will give number of lightning
occurrence in a region. I have used factor function to sum up the number of
events on latitude and longitude axis and saved as x and y. But when I tried
to plot the two, I had and error message ( Error in image.default(x, y, z) :
2010 Sep 03
2
Interactions in GAM
Hello R users,
I am working with the GAM to inspect the effect of some factors (year, area) and continuous variables (length, depth, latitude and longitude) on the intensity and prevalence of the common parasite Anisakis. I would like introduce interaction in my models, both "continuous variables-continuous variables" and "continuous variables-factor". I have read some
2018 May 16
0
How to average values from grid cells with coordinates
Hi lily,
There are one or two assumptions to be made here. First is that the
latitude and longitude values of the "black" cells are equally spaced
as in your illustration. Second, that all latitude and longitude
values for the "red" cells fall at the corners of four "black" cells.
You can get the four "black" cells by finding the lat/lon values that
are
2016 Apr 27
1
Determine if a set of x and y-latitude points are inside of a polygon using R
Objective: Determine if a set of x and y-latitude points are inside of
a polygon using R.
Lets say I have 9 polygons. Where I have labeled the polygons to be
checked from 1-9. The problem I?m running into is running the
point.in.polygon to check if those points are in one of several
polygons, as my code overwrites the result.
To accomplish this I am using the R-built in function called