search for: city

Displaying 20 results from an estimated 3109 matches for "city".

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="Lisbon",cod=3))) city<-rbind(city,data.frame(city="Milan",cod=4)) city<-rbind(city,data.frame(city="London",cod=5)...
2012 Mar 20
2
Unique in DataFrame
Hello, I have little doubt, and I do not think that the way I solve the problem is the best way to do it. The following is a small dataset x<-data.frame(city="Barcelona",sales=253639) x<-rbind(x,data.frame(city="Madrid",sales=223455)) x<-rbind(x,data.frame(city="Lisbon",sales=273633)) x<-rbind(x,data.frame(city="Madrid",sales=266535)) x<-rbind(x,data.frame(city="Barcelona",sales=258369)) x&lt...
2018 Jan 15
5
barplot that displays sums of values of 2 y colums grouped by different variables
I am trying to create a barplot displaying the sums of 2 columns of data grouped by a variable. the data is set up like this: "city" "n" "y" <br> mon 100 200 <br> tor 209 300 <br> edm 98 87 <br> mon 20 76 <br> tor 50 96 <br> edm 62 27 <br> the resulting plot should have city as the x-axis, 2 bars per city, 1 representing the sum of "n" in that city,...
2006 Dec 30
4
newbie question, "show items in selected city and category"
...i, 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 that user can act such way: first, from cities listing, which is produced by ''list'' method in cities_controller, the user chooses city ( clicks on ''show'' link). cities_controller#show contai...
2004 Apr 29
3
Dummies in R
Dear all, my problem is following. I know Stata, but currently I have to use R. Could You please help in finding the analogy 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 ne...
2011 Feb 02
2
Efficient way to determine if a data frame has missing observations
...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","A","B","B","C") var<-c("sqmi","pop","emp","pop","emp","pop") value<-c(10,100,40,30,10,20) df<-data.frame(city,var,value) In this data frame, city A has c...
2012 May 28
4
How to load a selection list into the method new of a controller?
Hi friends! I''m relatively 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) no...
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 city code...
2017 Oct 16
1
Download data from NASA for multiple locations - RCurl
...3), 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(mydata)) ### The information for cities look like this: ### cities <- dput(droplevels(head(cities, 5))) structure(list(...
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
...ows and do the 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)))...
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
...emperature), 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"), state = structure(c(2L, 1L, 2L, 2L, 1L), .Label = c(" CT ", " MA "), class = "factor"), lon =...
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='' + $F(''citi'')", :url => { :actio...
2017 Oct 16
0
Download data from NASA for multiple locations - RCurl
...substr(x, 9, 10), > 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 "Introdu...
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....
2017 Oct 15
0
Download data from NASA for multiple locations - RCurl
...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"), state = > structure(c(2L, > 1L, 2L, 2L, 1L), .Label = c(" CT ", " MA "), class = "factor&quo...
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
...age: 'dplyr' #> The following objects are masked from 'package:stats': #> #> filter, lag #> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union library(tidyr) # gather dta <- read.table( text = "city n y mon 100 200 tor 209 300 edm 98 87 mon 20 76 tor 50 96 edm 62 27 ", header = TRUE ) dta2 <- ( dta %>% group_by( city ) %>% summarise( n = sum( n ) , y = sum( y ) ) %>% gather( Response, value, -city )...
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 all individuals. I also tried constructing a new array with mean Height for e...
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 %></td&g...
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 must b...