[R] Sample based on Factor Selection Criteria

2009-06-01 Thread Josip Dasovic
43 6.2 1.4 0 red 33 5.2 1.5 1 red 35 4.2 1.6 1 red 28 4.4 1.4 0 Thank you for your help, Josip Josip Dasovic Research Associate Human Security Report Project School of International Studies Suite 7200 Simon Fraser Uni

[R] Generating new variable based on values of an existing variable

2009-02-09 Thread Josip Dasovic
Dear R Help-Listers: I have a problem that seems like it should have a simple solution, but I've spent hours on it (and searching the r-help archives) to no avail. What I'd like to do is to generate a new variable within a data frame, the values of which are dependent upon the values of an exis

Re: [R] Data Frame Manipulation: Time Series

2009-01-27 Thread Josip Dasovic
Hello Jim: Yes, that's exactly what I needed! Thank you! Josip - Original Message - From: "jim holtman" To: "Josip Dasovic" Cc: r-help@r-project.org Sent: Tuesday, January 27, 2009 4:45:31 PM GMT -08:00 US/Canada Pacific Subject: Re: [R] Data Frame Manipula

[R] Data Frame Manipulation: Time Series

2009-01-27 Thread Josip Dasovic
Dear R Helpers: I have a data set where the unit of observation is country-year. I would like to generate a new data set based on some inclusionary (exclusionary) criteria. Here is an example of the type of data that I have. df<-data.frame(cbind("country"=c(rep("Angola", 9), rep("Burundi", 7),

[R] Drawing Polygons with xyplot in lattice

2009-01-12 Thread Josip Dasovic
Hello: I've come to a dead-end in my search for a solution to a graphing problem that I am encountering. I have used xyplot (from the lattice package) successfully to plot 36 time-series plots (lines) of under-5 mortality for a set of countries in Sub-Sarahan Africa. What I would now like to

Re: [R] Confusion with Converting Factors to Dates using as.date

2008-12-10 Thread Josip Dasovic
. Vancouver, BC V6B 5K3 Canada - Original Message - From: "Peter Dalgaard" <[EMAIL PROTECTED]> To: "Josip Dasovic" <[EMAIL PROTECTED]> Cc: r-help@r-project.org Sent: Wednesday, December 10, 2008 1:16:48 PM GMT -08:00 US/Canada Pacific Subject: Re: [R] Confusion with C

[R] Confusion with Converting Factors to Dates using as.date

2008-12-10 Thread Josip Dasovic
Dear R-Helpers: I'm having a problem getting dates into the correct format. I have a data frame, which is based on a .csv file that I imported into R via read.table. R has converted my date variables to factors; when I use the as.Date command, most of the values are converted "correctly" (and b

Re: [R] Change color of plot points based on values of a variable

2008-10-01 Thread Josip Dasovic
anada Pacific Subject: Re: [R] Change color of plot points based on values of a variable Josip Dasovic sfu.ca> writes: > I have run a logistic regression, used Gelman et al.'s car package to >> simulate the parameter estimates of "car" is by John Fox. You meant "arm

[R] Change color of plot points based on values of a variable

2008-10-01 Thread Josip Dasovic
Dear R users: I have run a logistic regression, used Gelman et al.'s car package to simulate the parameter estimates of that model, and have plotted the probability (using Gelman et al.'s invlogit() function) of the dependent variable being 1 given the value of a particular independent variable

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Josip Dasovic
I think that Marko wanted his rows to be reversed, such that the first row becomes the last, while the second row becomes the second-to-last row, etc. If I am assuming correctly, this will do what you want: x<-data.frame(cbind(1:10, 1:10, 1:10, 1:10)) print(x) X1 X2 X3 X4 1 1 1 1 1 2 2

[R] Stacked Area Plot

2008-09-17 Thread Josip Dasovic
Hi: I've searched the archives and the Internet for hours but have yet to find a way to do stacked area plots (like the kind in Excel) in R. I think that polygon may work but it would require a bit of manipulation of my data. I was hoping for an easier way. An example of what I'm trying to do

[R] Calculating total observations based on combinations of variable values

2008-08-27 Thread Josip Dasovic
Hello: As someone making the move from STATA to R, I'm finding it difficult at times to perform basic tasks in R, so forgive me if I've missed an obvious and easily obtained solution to my problem. I've searched the help guides and the archives and have not been able to find a solution that w