Displaying 20 results from an estimated 3127 matches for "cities".
2012 Mar 26
2
copy the columns based on the code
Hello,
I have two different dataset, and wanted to join the two.
For example I have a table of codes of cities, and other with with the
codes of travels, [source for the destine].
what he wanted was to have a new data.frame with all the information
city<-data.frame(city="Barcelona",cod=1)
city<-rbind(city,data.frame(city="Madrid",cod=2))
city<-rbind(city,data.frame(city="...
2012 Mar 20
2
Unique in DataFrame
...ty="Barcelona",sales=22579))
x<-rbind(x,data.frame(city="Lisbon",sales=26333))
x<-rbind(x,data.frame(city="Barcelona",sales=253639))
x$num<-as.numeric(as.numeric(factor(x$city)))
View(x)
my problem and my doubts start here, I'm trying to create a list of cities
and the code that was assigned in.
x$num<-as.numeric(as.numeric(factor(x$city)))
here seems to work fine, but the largest dataset repeats some values ??and
hiding others, this is the correct way to present unique values ??in a
column, and view the contents with other columns
rescity<-x[uniq...
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
...;n" in that city, the other the sum of "y" in
that city.
If possible also show the sum in each bar as a label?
I aggregated the data into sums like this:
sum_data <- aggregate(. ~ City,data=raw_data,sum)
this gave me the sums per city as I wanted but for some reason 1 of the
cities is missing in the output.
Using this code for the plot:
ggplot(sum_data,aes(x = City,y = n)) + geom_bar(aes(fill = y),stat =
"identity",position = "dodge")
gave be a bar plot with one bar per city showing the sum of y as a color
gradient. not what I expected given the "...
2006 Dec 30
4
newbie question, "show items in selected city and category"
Hi,
rails newbie needs help :)
I have classified ads (cads) related with cities and categories:
class Cad < ActiveRecord::Base
has_and_belongs_to_many :categories
has_and_belongs_to_many :cities
end
class Category < ActiveRecord::Base
has_and_belongs_to_many :cads
end
class City < ActiveRecord::Base
has_and_belongs_to_many :cads
end
I assume th...
2004 Apr 29
3
Dummies in R
...to R.
(1) creating of City-Dummy.
I know in Stata:
g byte city=0
replace city=1 if city==12&year==2000
and
(2) Create a Time-Dummy-Variable
g byte T2000=0
replace T2000=1 if year==2000
(3) I need the City DUmmy for the following combination: I have the financial flows between two cities in the state and I need the paired-Dummy for the exporter (state1) and importer (state2):
g byte city11=0
replace city11=1 if state1==12¦state2==12
(4) I am interesting in residuals for particular city==12. I have the Dummy for City==12 and regress it on Y-Variable. How could I extract from the...
2011 Feb 02
2
Efficient way to determine if a data frame has missing observations
I have a data set covering a large number of cities with values for characteristics such as land area, population, and employment. The problem I have is that some cities lack observations for some of the characteristics and I'd like a quick way to determine which cities have missing data. For example:
city<-c("A","A",&qu...
2012 May 28
4
How to load a selection list into the method new of a controller?
...tively new with Rails and I''m struggling for a long time with this
problem (it should have a pattern solution but until now I didn''t find it):
I have the following models: Institution, City, State and Country.
class Country < ActiveRecord::Base
has_many :states
has_many :cities, :through => :states
end
# == Schema Information
# Table name: countries
# id :integer not null, primary key
# sigla :string(2) not null
# nome :string(30) not null
class State < ActiveRecord::Base
has_many :cities
has_many :institutions, :thr...
2006 Jan 27
3
OT?: International number parsing
Can anyone shed some light on "rules" that might make the task of
parsing the country code and city codes from a dialed number in the
CDRs?
I know that there is almost never a case where a concatenated country
and city code could overlap with another country code, but what about
city codes and local numbers? Is it possible for a concatenated city
code and local number to match another
2017 Oct 16
1
Download data from NASA for multiple locations - RCurl
...month = substr(df, 6,7),
day = substr(df, 9, 10),
hour = substr(df, 12, 13),
temp = substr(df, 21, 27))
data_frames[[i]] <- df
}
What I have been have been having trouble is adding the following
information from the cities file (100 cities) for each of the downloaded
data files. I would like to do the following but automatically:
###
mydata$city <- rep(cities[1,1], nrow(mydata))
mydata$state <- rep(cities[1,2], nrow(mydata))
mydata$lon <- rep(cities[1,3], nrow(mydata))
mydata$lat <- rep(cities[1,4], nrow...
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
...following to add
identifying information:
###
mydata <- data.frame(year = substr(x,1,4),
month = substr(x, 6,7),
day = substr(x, 9, 10),
hour = substr(x, 12, 13),
temp = substr(x, 21, 27))
mydata$city <- rep(cities[1,1], nrow(mydata))
mydata$state <- rep(cities[1,2], nrow(mydata))
mydata$lon <- rep(cities[1,3], nrow(mydata))
mydata$lat <- rep(cities[1,4], nrow(mydata))
###
Is it possible to incorporate these into your code so the data looks like
this:
dput(droplevels(head(mydata)))
structure(list(y...
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
...00&endDate=1979-12-31T00&location=GEOM:POINT(-71.06,%2042.36)&type=asc2
###
In this case, variable: Tair_f_inst (temperature), location: (-71.06,
42.36), startDate: 01 January 1970; endDate: 31 December 1979; type: asc2
(output 2-column ASCII).
I am trying to download data for 100 US cities, data for which I have in
the following data.frame:
###
cities <- dput(droplevels(head(cities, 5)))
structure(list(city = structure(1:5, .Label = c("Boston", "Bridgeport",
"Cambridge", "Fall River", "Hartford"), class = "factor"), sta...
2006 Jun 28
3
observe_field and radio button... does not work?
I try to catch click event on radio button, but nothing is executed....
Tested with RoR 1.1.2 and 1.1.3. What am I doing wrong?
<%= radio_button_tag(:city, ''Dublin'') %>
<%= observe_field(:citi, :frequency => 0.5,
:on => ''click'',
:with => "''city='' +
2017 Oct 16
0
Download data from NASA for multiple locations - RCurl
...),
> hour = substr(x, 12, 13),
> temp = substr(x, 21, 27))
The time and temp items would naturally be read in with read.table (or in the case of tab-delimited data with read.delim) after skipping the first 14 lines.
>
> mydata$city <- rep(cities[1,1], nrow(mydata))
There's no need to use `rep` with data.frame. If one argument to data.frame is length n then all single elelment arguments will be "recycled" to fill in the needed number of rows. Please take the time to work through all the pages of "Introduction to R"...
2010 Feb 10
3
How to repeat the names?
Dear R helpers
I have a city.csv file as given below.
'city.csv'
city_name1 city_name2
New York City Buffallo
So I define
city_name = read.csv('city.csv')
city1 = city_name$city_name1
city2 = city_name$city_name2
My problem is how do I repeat the names one after other say 10 times i.e. my output should be like
New York
City Buffallo
New York
City
2017 Oct 15
0
Download data from NASA for multiple locations - RCurl
...cation=GEOM:POINT(-71.06,%2042.36)&type=asc2
> ###
>
> In this case, variable: Tair_f_inst (temperature), location: (-71.06,
> 42.36), startDate: 01 January 1970; endDate: 31 December 1979; type: asc2
> (output 2-column ASCII).
>
> I am trying to download data for 100 US cities, data for which I have in
> the following data.frame:
>
> ###
> cities <- dput(droplevels(head(cities, 5)))
> structure(list(city = structure(1:5, .Label = c("Boston", "Bridgeport",
> "Cambridge", "Fall River", "Hartford"), cl...
2006 Apr 25
4
belongs_to :through
belongs_to :through
Why is that not possible?
We should have:
Street
belongs_to :city
belongs_to :country, :through => :city
--
Posted via http://www.ruby-forum.com/.
2018 Jan 15
0
barplot that displays sums of values of 2 y colums grouped by different variables
...uot;y" in that
> city.
>
> If possible also show the sum in each bar as a label?
>
> I aggregated the data into sums like this:
>
> sum_data <- aggregate(. ~ City,data=raw_data,sum)
>
> this gave me the sums per city as I wanted but for some reason 1 of the
> cities is missing in the output.
>
> Using this code for the plot:
>
> ggplot(sum_data,aes(x = City,y = n)) + geom_bar(aes(fill = y),stat =
> "identity",position = "dodge")
>
> gave be a bar plot with one bar per city showing the sum of y as a color
> gradient...
2009 Aug 25
4
table, xyplot, names, & loops
Hi R community,
I'm just starting out in R and have a basic question about xyplot and
tables. Suppose I had a table of data with the following names: Height,
Age_group, City. I'd like to plot mean Height vs Age_group for each City.
When I try to do the following:
> library(lattice)
> xyplot(mean(Height) ~ Age_group | City)
of course I get just one data point, the mean Height for
2010 Aug 02
1
Drop down boxes from table data
Hi
I have another question for how best to do this. Now I have been
following the tutorial at:
http://www.tunaslut.com/learning-ruby-drop-down-lists-in-one-to-many-relationships,
however when I change the view over from
<% @cities.each do |city| %>
<tr>
<td><%=h city.city_name %></td>
<td><%=h city.country_id %></td>
to:
<% @cities.each do |city| %>
<tr>
<td><%=h city.city_name %></td>
<td><%=h city.country.country_name...
2012 Nov 30
4
Tokeninput incremental search not working
Rails 3.1.3
After watching
http://railscasts.com/episodes/258-token-fields?autoplay=true
I have installed the similar functionality to my app.
However,
def index
@cities = City.all
...
does in fact give the list of all cities in the text field, but
def index
@cities = City.where("name like ?", "%#{params[:q]}%")
...
does NOT search cities at all.
Since above case works (though not incremental filter), the problem...