[R] plot of computed vector

2007-03-25 Thread Mihai Nica
gReetings:

I apologize for the non-programming language. I found what seems to be a
strange behavior of plot(). The code follows:

#_
N=3030; gn=.04; tn=1:100
n=N/(1+(N-1)*exp(-gn*tn))
N=n*(1-exp(-gn*tn))/(1-n*exp(-gn*tn))
plot(N) #strange plot

N

N=rep(3030, 100)
plot(N) #behaves as expected


Windows XP, R 2.4.0. or 2.4.1

Thanks,


-- 
Mihai Nica
Jackson State University
112 Channing Cir.
Canton, MS 39046
601-914-0361

The least of learning is done in the classrooms.
  - Thomas Merton

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plot of computed vector

2007-03-25 Thread Mihai Nica
Wow. I understand, thanks.

m
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: hadley wickham [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: R list r-help@stat.math.ethz.ch
Sent: Sunday, March 25, 2007 7:53:14 AM
Subject: Re: [R] plot of computed vector

 I apologize for the non-programming language. I found what seems to be a
 strange behavior of plot(). The code follows:

 #_
 N=3030; gn=.04; tn=1:100
 n=N/(1+(N-1)*exp(-gn*tn))
 N=n*(1-exp(-gn*tn))/(1-n*exp(-gn*tn))
 plot(N) #strange plot

 N

Have a look at diff(N) to see what's going on.

The default axis labels and printing display too few decimal places to
see the differences between the numbers.

Hadley

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







 

Food fight? Enjoy some healthy debate 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] something missing in summary()

2007-02-16 Thread Mihai Nica
I will take advantage of this thread with a request of my own. Would it be 
possible to add an index in the result of str(df )? For large dfs I find myself 
counting for the position of certain variable(s) again and again (for indexing 
purposes).

Thanks,

m
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Douglas Bates [EMAIL PROTECTED]
To: Jari Oksanen [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Friday, February 16, 2007 7:58:01 AM
Subject: Re: [R] something missing in summary()

On 2/16/07, Jari Oksanen [EMAIL PROTECTED] wrote:
 Gerard Smits g_smits at verizon.net Fri Feb 16 00:46:09 CET 2007:
  just noticed that two key pieces of information are not given by
  the summary() command:  N and SD.  we are given the N missing, but
  not the converse.  I know these summary value can be obtained easy,
  but can't understand why these two pieces of information are not
  provided with the other info.
 
 I assume you mean summary.data.frame?

Given a data frame, df, I would use

str(df)

before

summary(df)

because I want to see, for example, which columns are factors or
ordered factors or ...  That information is present in the value of
summary(df) but in a more subtle way.  As pointed out below the number
of rows in the data frame is the total number of observations for each
of the variables so putting that information in the summary for each
variable is redundant.

 There has even been an appeal on this:
 http://tolstoy.newcastle.edu.au/R/help/06/02/20706.html

 However, I didn't find any petition you could sign (but I found many
 surprising petitions when googling on this). Perhaps somebody will set
 up a petition page some day.

 With time, I've learnt that if something obvious is missing in the base
 R, there is a reason. Probably the Core thinks that you shouldn't use sd
 in a summary, but it is a poor and misleading statistic (they neither
 have skewness and kurtosis). You may learn to live without sd if you
 survive over the first impact.

I don't think this was an explicit decision by R-core.  It was a case
of S compatibility so the original decision was made at Bell Labs and
that group was highly influenced by John Tukey who worked with them. I
imagine that is why the summary of a numeric is a 'five-number'
summary plus the mean.  I would say the surprising and unconventional
part of that summary is the fact that it includes the mean.

 On the other hand, there are things like R-squared and significance
 stars in summary.lm, which spoils the image of purity in the Core.

However there is the option show.signif.stars which can be set to
FALSE and which I always do.

 Number of observations may not be very useful in summary.data.frame,
 because it varies so little among variables.

 The R-help message cited above and its follow-ups suggest some ways of
 locally modifying the code and maintaining the modifications over the
 upgrades of R.

 Best wishes, Jari Oksanen

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







 

Finding fabulous fares is fun.  

otel bargains.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Download stock prices

2007-02-05 Thread Mihai Nica
Thanks for the tips! 

Looking over the discussion I realized I
might have been unclear. What I would like to do is download a *large*
number of values for a certain date. I understood how to do download
data for a specific stock, but any idea as to how I could download
values for all (or a sample of) companies for a specific date :-)?

something like...
 yahooSeries(symbols = c(ALL), from = NULL, to = NULL, 
nDaysBack = 365, quote = c(Open, High, Low, Close, Volume), 
aggregation = c(d, w, m), returnClass = c(timeSeries, ts, 
matrix, data.frame), getReturns = FALSE, ...) thanks, 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Martin Maechler [EMAIL PROTECTED]
To: Matthew Keller [EMAIL PROTECTED]
Cc: Mihai Nica [EMAIL PROTECTED]; R list r-help@stat.math.ethz.ch
Sent: Monday, February 5, 2007 8:01:04 AM
Subject: Re: [R] Download stock prices

Hi Matthew,

 Matthew == Matthew Keller [EMAIL PROTECTED]
 on Sun, 4 Feb 2007 23:06:46 -0500 writes:

Matthew Hi Mihai, You might check out the Rmetrics bundle,
Matthew available on the cran website. I've used its
Matthew fBasics library

it's the fBasics *package*; a library is something (actually
more than one thing!) different!

Matthew to download stock prices. Try the
Matthew yahooImport() function and the keystats() function
Matthew for downloading specific stock prices. I had to
Matthew fiddle with the keystats function to get it to work
Matthew properly, but I wrote to the writer of the library

you mean the maintainer of the *package* 

Matthew and it may have been fixed by now.

the function is (now) called  keystatsImport() and is part of
'fCalendar' -- which is automatically required from package
'fBasics'.
help(keystatsImport) contains several examples, unfortunately
explicitly not available through example(), but I can
successfully execute all of them -- and they do work, including
the yahooImport() one.

Martin Maechler, ETH Zurich

Matthew Best of luck,

Matthew Matt

Matthew On 2/4/07, Mihai Nica [EMAIL PROTECTED] wrote:
 gReetings:
 
 Is there any way to download a (or a sample of a)
 crossection of stock market prices? Or is it possible to
 use get.hist.quote with a *wild card*?
 
 Thanks,
 
 mihai
 
 Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201
 601-914-0361


Matthew -- Matthew C Keller Postdoctoral Fellow Virginia
Matthew Institute for Psychiatric and Behavioral Genetics







 




[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Download stock prices

2007-02-04 Thread Mihai Nica
gReetings:

Is there any way to download a (or a sample of a) crossection of stock market 
prices? Or is it possible to use get.hist.quote with a *wild card*?

Thanks,

mihai
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361




 

8:00? 8:25? 8:40? Find a flick in no time 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] counties in different colours using map()

2006-12-27 Thread Mihai Nica
since dr. bivand seems to be away, i will try to help a little :-) 

i did not work with the database that comes with maps, but with shapefiles from 
http://www.census.gov/geo/www/cob/co2000.html#shp. you need to merge the 
dataframe that you have with the shapefile. 

do you have access to gis software? the merging can be done with r but it is 
quite cumbersome. 

The road to plot the map could be:

_
require(maptools)
a=read.shape(your_merged_file.shp, dbf.data=TRUE, verbose=TRUE)
attach(a)
win.graph(width=5,height=3, pointsize=8)
plot.Map(a, auxvar=the_variable_to_plot_from_dbf_file, xlab= , ylab= ,
 ol=NA)
__
 
more about this at: http://cran.r-project.org/src/contrib/Views/Spatial.html

hth,
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Tord Snäll [EMAIL PROTECTED]
To: R-help@stat.math.ethz.ch
Sent: Wednesday, December 27, 2006 5:12:04 AM
Subject: [R] counties in different colours using map()

Hi,
I would like to plot a map of US counties using different colors. map() 
seems to be the function to use, e.g.
library(maps); map('usa'); map('county', 'colorado', add=T,fill = T, 
col=c(1:5))
plots Colorado counties using colours 1 to 5.

However, I want each color to represent a certain value - a value to be 
picked from a data frame.
This code should show a correspoding map at the level of states:
state.names - system('tr [A-Z] [a-z]', state.name)
map.states - unix('sed s/:.*//', map(names=T,plot=F))
state.to.map - match(map.states, state.names)
color- votes.repub[state.to.map, votes.year = 1900] / 100
map('state', fill=T, col=color); map('state', add=T)
It is copied from page 6 in
Richard A. Becker, and Allan R. Wilks, Maps in S, ATT Bell 
Laboratories Statistics Research Report [93.2], 1993.
http://public.research.att.com/areas/stat/doc/93.2.ps

I also wonder whether the county names are available in the database 
used by map(), and, if yes, how to extract or utilize them.

Thanks!

Tord

-- 

Tord Snäll
Department of Conservation Biology
Swedish University of Agricultural Sciences (SLU)
P.O. 7002, SE-750 07 Uppsala, Sweden
Office/Mobile/Fax
+46-18-672612/+46-730-891356/+46-18-673537
E-mail: [EMAIL PROTECTED]
www.nvb.slu.se/staff_tordsnall

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.






__



[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Colour-coded Editor for R Code

2006-11-06 Thread Mihai Nica
But in Win you could try Tinn-R which is quite good!! 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Richard M. Heiberger [EMAIL PROTECTED]
To: Jon Minton [EMAIL PROTECTED]; R-help@stat.math.ethz.ch
Sent: Monday, November 6, 2006 7:45:54 AM
Subject: Re: [R] Colour-coded Editor for R Code

Emacs and ESS for both Unix and Windows.

emacs for Windows from
ftp://ftp.gnu.org/pub/gnu/emacs/windows/emacs-21.3-fullbin-i386.tar.gz

emacs for Unix from
ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.4a.tar.gz


ESS from
http://ess.r-project.org/
Click on Source for the package itself.
Other items on the page give documentation.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plot history

2006-10-30 Thread Mihai Nica
Or maybe see ?win.graph. Before each graph use something like:

win.graph(width=3,height=3, pointsize=8)

You will get a sandwich of graphs.

hth,
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Rohini Mulford [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Monday, October 30, 2006 4:29:21 PM
Subject: [R] plot history


___




Hi,
 
When I create multiple graphs subsequent graphs overwrite previous
graphs. How do I keep all my graphs in the current workspace (but not
all on the same page) so I can scroll through them?
 
 
thanks,
 
Rohini
 
 
 
Rohini Mulford

Senior Research Analyst

Technical Research

Research  Development

Insurance Australia Group(IAG)

ph (02) 9292 1560

fax (02) 9292 1509

email: [EMAIL PROTECTED]

 

 


___

The information transmitted in this message and its attachme...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Header of dataframe

2006-10-26 Thread Mihai Nica
names(temp)[1]=a

see: ?names

did you really created that function :-)?
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Benjamin Dickgiesser [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Thursday, October 26, 2006 12:08:08 PM
Subject: [R] Header of dataframe

Hi
I am fairly new to R and I would appreciate some help to hopefully a
trivial problem.

I created a function:

summary.aggregate - function(y, ...)
{
temp.mean - aggregate(y, FUN=mean, ...)
temp.sd  - aggregate(y, FUN=sd, ...)
temp.length - aggregate(y, FUN=length, ...)
temp - data.frame(cbind(mean=temp.mean$x,stdev=temp.sd$x,n=temp.length$x))
}

this outputs e.g.:

  meanstdev  n
1 645.6125 65.94129 60
2 655.2121 70.64094 60
3 633.3161 80.48620 60
4 650.3897 77.59191 60
5 630.4955 84.9 60
6 656.2608 66.16100 60
7 666.1775 74.39796 60
8 663.1543 71.10769 60

Is there an easy way to add a column name to the first column?

Thank you,
Benjamin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Header of dataframe

2006-10-26 Thread Mihai Nica
Oh, I can see now what you mean. That's beyond me, but... why :-)?
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Benjamin Dickgiesser [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Thursday, October 26, 2006 4:35:20 PM
Subject: Re: [R] Header of dataframe

Thx for the help but again, this is not what I am looking for. I need
the  a to be over the first column e.g.

ameanstdev  n
1 645.6125 65.94129 60
2 655.2121 70.64094 60
3 633.3161 80.48620 60
4 650.3897 77.59191 60
5 630.4955 84.9 60
6 656.2608 66.16100 60
7 666.1775 74.39796 60
8 663.1543 71.10769 60



On 10/26/06, Mihai Nica [EMAIL PROTECTED] wrote:

 names(temp)[1]=a

 see: ?names

 did you really created that function :-)?
  Mihai Nica
 170 East Griffith St. G5
 Jackson, MS 39201
 601-914-0361


 - Original Message 
 From: Benjamin Dickgiesser [EMAIL PROTECTED]
 To: r-help@stat.math.ethz.ch
 Sent: Thursday, October 26, 2006 12:08:08 PM
 Subject: [R] Header of dataframe

 Hi
 I am fairly new to R and I would appreciate some help to hopefully a
 trivial problem.

 I created a function:

 summary.aggregate - function(y, ...)
 {
 temp.mean - aggregate(y, FUN=mean, ...)
 temp.sd  - aggregate(y, FUN=sd, ...)
 temp.length - aggregate(y, FUN=length, ...)
 temp -
 data.frame(cbind(mean=temp.mean$x,stdev=temp.sd$x,n=temp.length$x))
 }

 this outputs e.g.:

   meanstdev  n
 1 645.6125 65.94129 60
 2 655.2121 70.64094 60
 3 633.3161 80.48620 60
 4 650.3897 77.59191 60
 5 630.4955 84.9 60
 6 656.2608 66.16100 60
 7 666.1775 74.39796 60
 8 663.1543 71.10769 60

 Is there an easy way to add a column name to the first column?

 Thank you,
 Benjamin

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross two dataframe

2006-10-13 Thread Mihai Nica
Actually, I'm a beginner too :-) It's just this list is so helpful, and I was 
helped so many times, that I am trying to bring my small contribution :-)
How about:

#_
Y1=X*Y[,1]
Y=cbind(Y,Y1)
Y

  site1 site2 site3 site4 site5 site6 site7 stage1 stage2 stage3
A 1 5 913172125  1  5  9
B 2 61014182226  4 12 20
C 3 71115192327  9 21 33
D 4 81216202428 16 32 48
#___

And then change the names as you like... I bet there is a more elegant way, but 
it seems to work :-)

hth,
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Majid Iravani [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Sent: Friday, October 13, 2006 1:58:29 AM
Subject: Re: [R] Cross two dataframe

Dear Mihai Nica
Thanks. Actually I dont want to merge two data frames.
For example if I have two matrixes X and Yas follow:

X- matrix(1:12, nrow=4, ncol=3, dimnames=list(c(A,B,C,D), 
c(stage1,stage2,stage3)))

Y- matrix(1:28, nrow=4, ncol=7, dimnames=list(c(A,B,C,D), 
c(site1,site2,site3,site4,site5, site6,site7)))

  I would like to multiply first column of the Ymatrix (site1) to the all 
of the columns in Xmatrix. Then, the product will be three new columns 
(site1stage1, site1stage2 and site1stage3) which I want to add to Ymatrix. 
As my site (Y) dataset has about 400 columns its not easy to do it in Excel 
and Im looking for a command in R to prepare a new data frame for more 
analysis. So I would greatly appreciate if you help me in this case.
Thanks a lot again
Majid





At 10:06 AM 10/12/2006 -0700, you wrote:
Mihai Nica


  Majid Iravani
  PhD Student
  Swiss Federal Research Institute WSL
  Research Group of Vegetation Ecology
  Zürcherstrasse 111  CH-8903 Birmensdorf  Switzerland
  Phone: +41-1-739-2693
  Fax: +41-1-739-2215
  Email: [EMAIL PROTECTED]
http://www.wsl.ch/staff/majid.iravani/









[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Cross two dataframe

2006-10-12 Thread Mihai Nica
I am unsure what you need, but try ?merge. If this isn't what you need, try 
posting an example.

hth,
 
Mihai Nica
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

- Original Message 
From: Majid Iravani [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Thursday, October 12, 2006 7:45:19 AM
Subject: [R] Cross two dataframe


Dear r-users!

I would like to cross two data frame which have the same row number but 
different in the number of column. Can anybody help me for this case ?

Thanks a lot in advance


  Majid Iravani
  PhD Student
  Swiss Federal Research Institute WSL
  Research Group of Vegetation Ecology
  Zürcherstrasse 111  CH-8903 Birmensdorf  Switzerland
  Phone: +41-1-739-2693
  Fax: +41-1-739-2215
  Email: [EMAIL PROTECTED]
http://www.wsl.ch/staff/majid.iravani/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] merge and polylist

2006-10-09 Thread Mihai Nica
The answer to all your questions is simple. By the time I get a little grasp on 
things,  they become deprecated :-). But my programming skills are so low, 
that I find this normal.

My problem comes from the last two #comment lines :

#(if data row names do not match polygon IDs, will reorder, or fail if 
# any differ or absent

The two data row names differ and some are absent, that's why I used merge 
(and posted on this list, not on r-sig-geo :-)). How else can I intersect the 
two data.frames?

Thanks so much for your help!


- Original Message 
From: Roger Bivand [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Sunday, October 8, 2006 3:10:16 PM
Subject: Re: [R] merge and polylist

On Sat, 7 Oct 2006, Mihai Nica wrote:

 Greetings:
 
 I would like to kindly ask for a little help. The rough code is:
 

Maybe R-sig-geo would be a more relevant list. Comments inline.

 #
 
 dat=data.frame(read.delim(file=all.txt, header = TRUE, sep = \t,
 quote=\, dec=.,na.strings = NA))

We do not know if dat is in the same order as the shapefile. If dat$cod is 
malformed wrt. nc$att.data$AREA (very strange choice, in ESRI generated 
files often the polygon area), you are asking for trouble.

 
 nc=read.shape(astae.shp, dbf.data=TRUE, verbose=TRUE)
 
 mappolys=Map2poly(nc)
 
 submap - subset(mappolys, nc$att.data$NAME!=Honolulu, HI)
 
 nc$att.data=subset(nc$att.data, nc$att.data$NAME!=Honolulu, HI)
 

In situations like this, overwriting the input is not advisable, bercause
you destroy your ability to check that the output corresponds to your
intentions.
  
 nc$att.data[,1]=as.numeric(paste(nc$att.data$MSACMSA))
 
 #attributes(nc$att.data)
 
 nc$att.data=merge(nc$att.data, dat, by.x=AREA, by.y=cod, all.x=TRUE,
 sort=FALSE)

Ditto.

 
 #attributes(nc$att.data)
 
 tmp=file(tmp)
 
 write.polylistShape(submap, nc$att.data, tmp)
 

Any good reason for not using the sp class framework? The objects you are 
using here are very low-level and messy.

library(maptools)
nc_1 - readShapePoly(system.file(shapes/sids.shp, package=maptools)[1],
  ID=FIPS) # put shapefile in SpatialPolygonsDataFrame
nc_2 - nc_1[coordinates(nc_1)[,1]  -80,] # subset with [ method
row.names(as(nc_2, data.frame))
as.character(nc_2$FIPS)
tmpfl - paste(tempfile(), dbf, sep=.)
download.file(http://spatial.nhh.no/misc/nc_xtra.dbf;;, tmpfl, mode=wb)
nc.df - read.dbf(tmpfl) # extra data keyed on CNTY_ID
nc_2$CNTY_ID
nc.df$CNTY_ID
nc_df2 - merge(as(nc_2, data.frame), nc.df, by=CNTY_ID, sort=FALSE)
all.equal(nc_df2$CNTY_ID, nc_2$CNTY_ID)
row.names(nc_df2) - nc_df2$FIPS # re-instate IDs
nc_3 - SpatialPolygonsDataFrame(as(nc_2, SpatialPolygons), data=nc_df2)
# (if data row names do not match polygon IDs, will reorder, or fail if 
# any differ or absent
writePolyShape(nc_3, nc_3)

This still isn't as tidy as it could be, but gives much more control than 
the original old-style classes.

Roger


 #_
 
 All works fine, but merge() changes the rownames and the link between the
 polygons and the corresponding rows is lost. I tried numerous other
 solutions (such as to paste back the old rownames), to no avail. After a
 few days, here I am. Please, if you have a moment, send a tip.
 
  Thanks,
 
  mihai
 
 
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] merge and polylist

2006-10-09 Thread Mihai Nica
Thanks! I believe I have all I need to solve my issue.

Thank you very, very much,

mihai

- Original Message 
From: Roger Bivand [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: Mihai Nica [EMAIL PROTECTED]; r-help@stat.math.ethz.ch
Sent: Monday, October 9, 2006 9:20:36 AM
Subject: Re: [R] merge and polylist

On Mon, 9 Oct 2006, Mihai Nica wrote:

 The answer to all your questions is simple. By the time I get a little
 grasp on things, they become deprecated :-). But my programming skills
 are so low, that I find this normal.

 My problem comes from the last two #comment lines :

 #(if data row names do not match polygon IDs, will reorder, or fail if 
 # any differ or absent

 The two data row names differ and some are absent, that's why I used
 merge (and posted on this list, not on r-sig-geo :-)). How else can I
 intersect the two data.frames?

Yes, use merge, but do look carefully at both of the input data frames, 
the by.x= and by.y= columns, and the output data frame. The sp classes 
give an ID to each polygon:

sapply(slot(object, polygons), function(x) slot(x, ID))

and that has to be identical to the row names of the output data frame - 
but can be in a different order. Constructing the SpatialPolygonsDataFrame 
will put the data frame rows in the order of the polygons.

Roger


 Thanks so much for your help!


- Original Message 
From: Roger Bivand [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Sunday, October 8, 2006 3:10:16 PM
Subject: Re: [R] merge and polylist

On Sat, 7 Oct 2006, Mihai Nica wrote:

 Greetings:
 
 I would like to kindly ask for a little help. The rough code is:
 

Maybe R-sig-geo would be a more relevant list. Comments inline.

 #
 
 dat=data.frame(read.delim(file=all.txt, header = TRUE, sep = \t,
 quote=\, dec=.,na.strings = NA))

We do not know if dat is in the same order as the shapefile. If dat$cod is 
malformed wrt. nc$att.data$AREA (very strange choice, in ESRI generated 
files often the polygon area), you are asking for trouble.

 
 nc=read.shape(astae.shp, dbf.data=TRUE, verbose=TRUE)
 
 mappolys=Map2poly(nc)
 
 submap - subset(mappolys, nc$att.data$NAME!=Honolulu, HI)
 
 nc$att.data=subset(nc$att.data, nc$att.data$NAME!=Honolulu, HI)
 

In situations like this, overwriting the input is not advisable, bercause
you destroy your ability to check that the output corresponds to your
intentions.
  
 nc$att.data[,1]=as.numeric(paste(nc$att.data$MSACMSA))
 
 #attributes(nc$att.data)
 
 nc$att.data=merge(nc$att.data, dat, by.x=AREA, by.y=cod, all.x=TRUE,
 sort=FALSE)

Ditto.

 
 #attributes(nc$att.data)
 
 tmp=file(tmp)
 
 write.polylistShape(submap, nc$att.data, tmp)
 

Any good reason for not using the sp class framework? The objects you are 
using here are very low-level and messy.

library(maptools)
nc_1 - readShapePoly(system.file(shapes/sids.shp, package=maptools)[1],
  ID=FIPS) # put shapefile in SpatialPolygonsDataFrame
nc_2 - nc_1[coordinates(nc_1)[,1]  -80,] # subset with [ method
row.names(as(nc_2, data.frame))
as.character(nc_2$FIPS)
tmpfl - paste(tempfile(), dbf, sep=.)
download.file(http://spatial.nhh.no/misc/nc_xtra.dbf;;;, tmpfl, mode=wb)
nc.df - read.dbf(tmpfl) # extra data keyed on CNTY_ID
nc_2$CNTY_ID
nc.df$CNTY_ID
nc_df2 - merge(as(nc_2, data.frame), nc.df, by=CNTY_ID, sort=FALSE)
all.equal(nc_df2$CNTY_ID, nc_2$CNTY_ID)
row.names(nc_df2) - nc_df2$FIPS # re-instate IDs
nc_3 - SpatialPolygonsDataFrame(as(nc_2, SpatialPolygons), data=nc_df2)
# (if data row names do not match polygon IDs, will reorder, or fail if 
# any differ or absent
writePolyShape(nc_3, nc_3)

This still isn't as tidy as it could be, but gives much more control than 
the original old-style classes.

Roger


 #_
 
 All works fine, but merge() changes the rownames and the link between the
 polygons and the corresponding rows is lost. I tried numerous other
 solutions (such as to paste back the old rownames), to no avail. After a
 few days, here I am. Please, if you have a moment, send a tip.
 
  Thanks,
 
  mihai
 
 
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.








-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]








[[alternative HTML version deleted

[R] merge and polylist

2006-10-07 Thread Mihai Nica
Greetings:

I would like to kindly ask for a little help. The rough code is:

#

dat=data.frame(read.delim(file=all.txt, header = TRUE, sep = \t,
quote=\, dec=.,na.strings = NA))

nc=read.shape(astae.shp, dbf.data=TRUE, verbose=TRUE)

mappolys=Map2poly(nc)

submap - subset(mappolys, nc$att.data$NAME!=Honolulu, HI)

nc$att.data=subset(nc$att.data, nc$att.data$NAME!=Honolulu, HI)

nc$att.data[,1]=as.numeric(paste(nc$att.data$MSACMSA))

#attributes(nc$att.data)

nc$att.data=merge(nc$att.data, dat, by.x=AREA, by.y=cod, all.x=TRUE,
sort=FALSE)

#attributes(nc$att.data)

tmp=file(tmp)

write.polylistShape(submap, nc$att.data, tmp)

#_

All works fine, but merge() changes the rownames and the link between the
polygons and the corresponding rows is lost. I tried numerous other
solutions (such as to paste back the old rownames), to no avail. After a
few days, here I am. Please, if you have a moment, send a tip.

 Thanks,

 mihai


-- 
Mihai Nica
170 East Griffith Street G5
Jackson, MS 39201

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ols/gls or systemfit (OLS, WLS, SUR) give identical results

2006-07-17 Thread Mihai Nica
  I should have not send the post to the list, and I apologize. The problem was 
on my part, and easily solvable. Thanks for your concern, I really appreciate 
it, and thanks to the list for patience. This is really a great resource and 
should not be abused :-)
  mihai

Spencer Graves [EMAIL PROTECTED] wrote:I can't say without more 
information.  If the system were saturated 
(i.e., has as many equations as unknowns), you should get the same 
answer from all the different methods.  However, I just tried a 
saturated model in 'systemfit', with the following results:

  DF2 - data.frame(y=1:2, x=3:4)
  lm(y~x, DF2)
Call:
lm(formula = y ~ x, data = DF2)

Coefficients:
(Intercept)x
  -21
  library(systemfit)
  systemfit(OLS, list(eqn=y~x), data=DF2)
Error in solve.default(sigma, tol = solvetol) :
 system is computationally singular: reciprocal condition number = 0
 
   If you'd like more help from this listserve, please supply a simple, 
self-contained example to illustrate your question (as suggested in the 
posting guide! www.R-project.org/posting-guide.html).

   Hope this helps.
   Spencer Graves

Mihai Nica wrote:
I might be sorry for asking this question :-)
 
 I have two equations and I tried to estimate 
them individually with lm and gls, and then in a
system (using systemfit)  with OLS, WLS and SUR.
Quite surprisingly (for myself at least) the results
are identical to the last digit.
 
 Could someone (please!) give a hint as to what 
am I doing wrong?
 
 Thanks,
 
 mihai

 -
 
 
  [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



-
See the all-new, redesigned Yahoo.com.  Check it out.
[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] dataframe computation behaviour

2006-07-16 Thread Mihai Nica
Greetings:



I have a simple issue; the (probably cumbersome) code follows:

#___

datmod=(dat)

datmod$em96gbr=ifelse(datmod$em96gbr  0, log(datmod$em96gbr),
datmod$em96gbr)

datmod$em96spbr=ifelse(datmod$em96spbr  0, log(datmod$em96spbr),
datmod$em96spbr)

datmod[,4:8]=log(datmod[,4:8])

datmod[,10:13]=log(datmod[,10:13])

datmod[,15:28]=log(datmod[,15:28])

datmod[,4:23]=datmod[,4:23]-datmod$p97

datmod[,25:26]=datmod[,25:26]-datmod$p97

#__

It works fine with the exception of datmod[,26] where the operation -
datmod$p97 is not performed. I thought this might be interesting enough to
share with the list :-)



mihai

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Trailing on r-help messages

2006-07-16 Thread Mihai Nica
Or just reminding the rules to the list now and then (as it was done today). I, 
for one, am happy I got reminded, and appologise for my previous posting. 
Trying to provide reproductible code forced me to find my own mistake!

mihai

hadley wickham [EMAIL PROTECTED] wrote: Personally, I doubt anyone actually 
reads the bottom of the emails,
and generally it is too late anyway, as they have already sent the
message.  Much like the opening text in R, details in footer tend to
trigger legalese neurons and are largely ignored.

I think it would be more useful to radically redesign the signup page
so that pertinent information is highlighted and the page made easily
scannable.  As it is, the eye tends to skip to the action part and
fill out name and email address without reading the rest of the page.

Hadley

On 7/16/06, Gabor Grothendieck  wrote:
 I would like to propose that we change the trailer on r-help
 messages which is currently:

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

 to add the following 4th line:

and provide minimal, self-contained, reproducible code.

 The posting guide is so long that I suspect few people really read
 it so at least this way the most important part of the message about
 posting would be readily visible without further user action.

 Of course minimal refers to cutting the code down to remove
 anything not related to the question at hand while self-contained
 and reproducible refer to being able to copy the code from
 the post and paste it into an R session to reproduce the
 problem.

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



Mihai Nica
ITT Tech instructor
Jackson State University
170 East Griffith St. G5
Jackson, MS 39201
601-914-0361

-

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] ols/gls or systemfit (OLS, WLS, SUR) give identical results

2006-07-13 Thread Mihai Nica
   I might be sorry for asking this question :-)

I have two equations and I tried to estimate them individually with lm 
and gls, and then in a system (using systemfit)  with OLS, WLS and SUR. 
Quite surprisingly (for myself at least) the results are identical to the last 
digit.

Could someone (please!) give a hint as to what am I doing wrong?

Thanks,

mihai

-


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] curiosity question: new graphics vs. old graphics subsystem

2006-07-02 Thread Mihai Nica
Well, as a newbee, I believe your idea is great. However, the R Core team is, 
in my humble opinion, way too stretched (for a free software development team) 
to do this. A complementary development team (similar to, say, the Tinn-R team) 
might be able to address this issue. I wish I would have the skills to 
contribute :-) Just my 2c.

The least of learning is done in the classrooms.
  - Thomas Merton


 Date: Sun, 2 Jul 2006 09:34:39 -0400
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: [R] curiosity question: new graphics vs. old graphics subsystem
 
 hi mihai:  it is more likely that the developers will take this more
 seriously if you echo my concern on r-help itself.  regards, /iaw
 
 On 7/1/06, Mihai Nica [EMAIL PROTECTED] wrote:
 
  Wow, this is what I would say if I knew how to say it :-) For newbees
  (such as myself) or those who lack programming expertise (and, why not, for
  those not interested in programming) this approach would be great.
  mihai
 
  
  Express yourself instantly with Windows Live Messenger

_
Express yourself: design your homepage the way you want it with Live.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] nls model singular gradient matrix parametrization

2006-06-02 Thread Mihai Nica

Yes! Now I can see it, it's so evident... Thank you so much,
m

Mihai Nica, ABD
Jackson State University
ITT Tech Instructor
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

The least of learning is done in the classrooms.
 - Thomas Merton



Original Message Follows
From: Prof Brian Ripley [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
CC: r-help@stat.math.ethz.ch
Subject: Re: [R] nls model singular gradient matrix parametrization
Date: Fri, 2 Jun 2006 07:03:02 +0100 (BST)

Your model is over-parametrized: d1*exp(-gt) gives two parameters for one 
constant.  As a result, the least-square surface is flat in one direction, 
and the gradient matrix is singular.


If this is the model you intended, you can simplify it by dropping d1.
It is also partially linear (d) so it should be possible to get 
method=plinear to work.


On Thu, 1 Jun 2006, Mihai Nica wrote:


Greetings,
I am having a very hard time with a nonlinear regression. The last chance 
is that maybe somebody can spot something wrong… The data and the model are 
described below:


number of observations = 3030
y = [0,…,~16]
D1969 = [.16,…,~70,000]

mod=nls(log(D1969)~d-log(1+d1*exp(-gt+g1*y)), start=list(d=11, d1=75, 
gt=14, g1=.9), trace=TRUE, data=pidg)
Error in nlsModel(formula, mf, start) : singular gradient matrix at initial 
parameter estimates


I ran several variants, changing the start values. However the graph with 
these starting values is almost identical with what is obtained with the 
real data (although it is rather nonlinear)… I am missing something, but 
can’t figure out what. If anybody has a little time and patience, any 
advice would be really really appreciated.

Thanks,


Mihai Nica, ABD
Jackson State University
ITT Tech Instructor
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

The least of learning is done in the classrooms.
- Thomas Merton




--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] nls model singular gradient matrix parametrization

2006-06-01 Thread Mihai Nica

Greetings,
I am having a very hard time with a nonlinear regression. The last chance is 
that maybe somebody can spot something wrong… The data and the model are 
described below:


number of observations = 3030
y = [0,…,~16]
D1969 = [.16,…,~70,000]

mod=nls(log(D1969)~d-log(1+d1*exp(-gt+g1*y)), start=list(d=11, d1=75, 
gt=14, g1=.9), trace=TRUE, data=pidg)
Error in nlsModel(formula, mf, start) : singular gradient matrix at initial 
parameter estimates


I ran several variants, changing the start values. However the graph with 
these starting values is almost identical with what is obtained with the 
real data (although it is rather nonlinear)… I am missing something, but 
can’t figure out what. If anybody has a little time and patience, any advice 
would be really really appreciated.

Thanks,


Mihai Nica, ABD
Jackson State University
ITT Tech Instructor
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

The least of learning is done in the classrooms.
 - Thomas Merton

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] after identify labels dissapear XP

2006-05-23 Thread Mihai Nica
Greetings:
Using 'identify' to label points on a plot works just fine. However, when 
saving under 'metafile' or using the clipboard the labels dissapear. I 
believe it's an SDI issue. I am running last R with last Tinn-r under XP up 
to date. Anything I can do besides going back to MDI :-)?
Thanks,

Mihai Nica, ABD
Jackson State University
ITT Tech Instructor
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

The least of learning is done in the classrooms.
  - Thomas Merton

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] text editor TinR?

2005-09-19 Thread Mihai Nica
Greetings,

Please help me remember the name of the tiny text editor that works with 
R TinR maybe? I cannot find it at all, and cannot remember it, it is 
really frustrating...

Thanks,

Mihai Nica, ABD
Jackson State University
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] text editor TinR?

2005-09-19 Thread Mihai Nica
Thanks to everybody answering my call for help. It is Tinn-R!

Mihai Nica, ABD
Jackson State University
170 East Griffith Street G5
Jackson, MS 39201
601 914 0361

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Multiple line plots

2005-06-15 Thread Mihai Nica

Greetings,

I would like to plot three lines on the same figure, and I am lost. There is 
an answer to a similar thread… but I tried matplot and it is beyond me. An 
example of the data follows:


YearEM  IM  BM
19839.1 16.8-7.7
198412.018.0-6.0
198513.619.1-5.5
198612.417.3-4.9
198714.620.3-5.7
198820.623.3-2.6
198925.027.2-2.2
199028.430.2-1.8
199133.331.22.1
199240.635.25.4
199341.639.91.7
199450.849.51.3
199546.361.7-15.4
199656.873.0-16.2
199771.485.9-14.5
199879.094.7-15.7
199987.0109.7   -22.7
2000111.7   135.9   -24.2
2001101.5   131.4   -29.9
200297.5134.6   -37.1
200397.4138.1   -40.6
2004110.8   155.8   -45.1

Thanks,

Mihai

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Coplot Given text

2004-11-26 Thread Mihai Nica
Greetings:

I am unsuccessful in suppressing Given : myvariable from a coplot. There was 
such a question in the past but the thread breaks down. I am sure this is a 
for dummies question :-). I tried:

coplot(myvar~myvar | myvar, show.given=FALSE, xlab=, ylab=..., main= )
and some other variations (including without main= ) but I have to go to the 
lower level and that is beyond me yet. I know, trellis is an option, but I want 
to be able to handle basics first.

Win2000, R 2.0.0

Many thanks,

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
601 914 0361

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Coplot Given text

2004-11-26 Thread Mihai Nica
Oh yes, many thanks! It does appear if I type coplot but I just didn't put
it together... I never imagined it has anything to do with xlab...

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
601 914 0361
- Original Message - 
From: Robert W. Baer, Ph.D. [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, November 26, 2004 1:51 PM
Subject: Re: [R] Coplot Given text


 Does this do what you want?
 coplot(myvar~myvar | myvar, show.given=FALSE, ylab=, xlab=c(...,A
 Title on Top))

 Rob
 - Original Message - 
 From: Mihai Nica [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, November 26, 2004 11:30 AM
 Subject: [R] Coplot Given text


  Greetings:
 
  I am unsuccessful in suppressing Given : myvariable from a coplot.
There
  was such a question in the past but the thread breaks down. I am sure
this
  is a for dummies question :-). I tried:
 
  coplot(myvar~myvar | myvar, show.given=FALSE, xlab=, ylab=...,
  main= )
  and some other variations (including without main= ) but I have to go
to
  the lower level and that is beyond me yet. I know, trellis is an option,
  but I want to be able to handle basics first.
 
  Win2000, R 2.0.0
 
  Many thanks,
 
  Mihai Nica
  Jackson State University
  155 B Parkhurst Dr.
  Jackson, MS 39202
  601 969 5423
  601 914 0361
 
  [[alternative HTML version deleted]]
 
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
  http://www.R-project.org/posting-guide.html
 



__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Descriptive statistics table

2004-10-17 Thread Mihai Nica
Greetings:

I would like to make a table with descriptive statistics for a data.frame. I guess the 
question is how can I put together, in a table, the results from, say:

apply(df, 2, mean, na.rm =T)
apply(df, 2, median, na.rm =T)
...

Thanks,

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
601 914 0361
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] coplot and par

2004-08-27 Thread Mihai Nica
Yes, I was trying cex.lab(). Now I understand why it didn't work.

Sincerely,

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
- Original Message - 
From: Prof Brian Ripley [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, August 27, 2004 2:33 AM
Subject: Re: [R] coplot and par


 On Fri, 27 Aug 2004, Prof Brian Ripley wrote:

  On Thu, 26 Aug 2004, Mihai Nica wrote:

 [...]

   This is the only explanation that I have for being unable to use par()
with
   coplot for changing the way the xlab and ylab appears.
 
  xlab and ylab are not part of par -- see its help page.
 
   From within coplot I can change the text itself but not the font,
   fontsize, etc, but par() before coplot has absolutely no effect
   wahtsoever (maybe it isn't supposed to?).
  
   I guess the question is: how can one change the way the xlab and ylab
appear
   on a coplot?
 
  They are listed as arguments to coplot, and work for me when given
there.

 Although you didn't mention them at all, did you mean specifying cex.lab
 and font.lab?   They do not work as the xlab and ylab in coplot are not
 `x and y labels' in the sense used in ?par: they are placed by mtext() not
 title().

 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595




__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] coplot and par

2004-08-26 Thread Mihai Nica
R 1.9.1 on Win2000 or Win98SE.
I am using coplot as follows:
coplot(AVG~LRPI| REGION)
the output seems normal but I get:
Warning message:
calling par(new=) with no plot
This is the only explanation that I have for being unable to use par() with 
coplot for changing the way the xlab and ylab appears. From within coplot I 
can change the text itself but not the font, fontsize, etc, but par() before 
coplot has absolutely no effect wahtsoever (maybe it isn't supposed to?).

I guess the question is: how can one change the way the xlab and ylab appear 
on a coplot?

Thanks,
Mihai
JSU
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Reading GAL file

2004-08-23 Thread Mihai Nica
Greetings:

I am trying to work with spdep (everything is brand new downloaded this morning). OS 
= Windows 2000 (also up to date). The code I am using follows:

#example

gal.county=read.geoda(lnpilnd.GAL, row.names=NULL, skip=0) 
summary.nb(gal.county)
Error in summary.nb(gal.county) : Not a neighbours list

#end

The gal file works just fine in GeoDa (also up to date). 

Thanks, I am really stuck here.

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Reading GAL file

2004-08-23 Thread Mihai Nica
Oh, that was easy, THANKS!

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
- Original Message - 
From: Roger Bivand [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, August 23, 2004 11:19 AM
Subject: Re: [R] Reading GAL file


 On Mon, 23 Aug 2004, Mihai Nica wrote:

  Greetings:
 
  I am trying to work with spdep (everything is brand new downloaded
  this morning). OS = Windows 2000 (also up to date). The code I am using
  follows:
 
  #example
 
  gal.county=read.geoda(lnpilnd.GAL, row.names=NULL, skip=0)

 Well, if you look at the help page for read.geoda() and read.gal(), you
 may see that read.gal() is what you use for reading the GAL file, and
 read.geoda() is just there as an easy way of using read.csv() for data
 files on the CSISS server. I can see that the help page could be clearer,
 it will be in the next release.

  summary.nb(gal.county)
  Error in summary.nb(gal.county) : Not a neighbours list
 
  #end
 
  The gal file works just fine in GeoDa (also up to date).
 
  Thanks, I am really stuck here.
 
  Mihai Nica
  Jackson State University
  155 B Parkhurst Dr.
  Jackson, MS 39202
  601 969 5423
  [[alternative HTML version deleted]]
 
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
 

 -- 
 Roger Bivand
 Economic Geography Section, Department of Economics, Norwegian School of
 Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
 Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
 e-mail: [EMAIL PROTECTED]




__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Looking for R course in Atlanta

2004-08-06 Thread Mihai Nica
see attached link

http://tolstoy.newcastle.edu.au/R/help/04/07/1491.html

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202
601 969 5423
- Original Message - 
From: eugene dalt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 06, 2004 2:27 PM
Subject: [R] Looking for R course in Atlanta


 I am looking to attend an R course this summer
 in Atlanta area. Any help?

 Thanks alot
 Eugene

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Colour coding and point types in a plot

2004-04-24 Thread Mihai Nica
R 1.8.1, Windows 2000.

I am trying to find the legend for color coding and point types in a plot, which 
probably are standard for everybody but myself. Thanks for the tip!

Mihai Nica
Jackson State University

No good deed will ever remain unpunished
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-20 Thread Mihai Nica
Why not ask those downloading rw1091 to complete (at their choice) a small
survey (including questions such as 'will it be used by a group or an
individual'). It would provide some data that could lead to an estimate as
good as anything else.

Mihai

- Original Message - 
From: Prof Brian D Ripley [EMAIL PROTECTED]
To: Peter Dalgaard [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; Philippe Grosjean
[EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 7:52 AM
Subject: Re: [R] Size of R user base


 On 20 Apr 2004, Peter Dalgaard wrote:

  [EMAIL PROTECTED] writes:
 
   On 20 Apr 2004 at 10:47, Philippe Grosjean wrote:
 
Of course, this will only work with computers connected to the
internet,... but at least, it could be one way to evaluate the
number
of R users. Would that be an infringment of Open Source, or any
other
rule of freedom? I don't know, but it does seem to be quite
widespread
(at least for commercial software). so, why an Open Source software
would not be able to monitor the number of users?
  
   That would make R into spyware, and there exist software to monitore
   and warn aganst/automatically remove spyware, and some users have
   such installed (and it will grow).
 
  Not quite spyware. Spyware generally works in more covert ways and
  tries to hide itself from the user.
 
  However, quite a few people think that having programs connecting to
  places on the internet without being asked is annoying and a potential
  invasion of privacy and it may even cost people money if they're on a
  dialup non-flat-fee connection.

 It is possible to ask: I mentioned pine, which does, and so do some perl
 installers.

 I don't think people would mind if the rw1091.exe installer had an option
 (ticked by default) to `call home', but I don't think we would learn
enough
 for this to be worth setting up.

 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272860 (secr)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Size of R user base

2004-04-20 Thread Mihai Nica
Well, it's a matter of taste. However, both the topic and the target group
would be totally different. Hopefully :-).

- Original Message - 
From: Duncan Murdoch [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 10:06 AM
Subject: Re: [R] Size of R user base


 On Tue, 20 Apr 2004 08:37:44 -0500, Mihai Nica [EMAIL PROTECTED]
 wrote:

 Why not ask those downloading rw1091 to complete (at their choice) a
small
 survey (including questions such as 'will it be used by a group or an
 individual'). It would provide some data that could lead to an estimate
as
 good as anything else.

 Yes, that sounds like a good idea.  That's more or less how People
 Magazine's 1998 survey to find the Most Beautiful People in the World
 was designed.  You might recall that Hank, the ugly drunken dwarf
 was the winner.

 Duncan Murdoch


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Panel Data Analysis

2004-04-12 Thread Mihai Nica
Greetings:

I am trying to find a package/solution for panel (longitudinal) data analysis. 
Unfortunately it seems I don't know where to start. Could somebody offer a hint?

Thanks,

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202

No good deed will ever remain unpunished
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Panel Data Analysis

2004-04-12 Thread Mihai Nica
Thanks, this is what I needed!

Sincerely,

Mihai Nica
Jackson State University
155 B Parkhurst Dr.
Jackson, MS 39202

No good deed will ever remain unpunished
- Original Message - 
From: Douglas Bates [EMAIL PROTECTED]
To: Mihai Nica [EMAIL PROTECTED]
Cc: R-Help [EMAIL PROTECTED]
Sent: Monday, April 12, 2004 11:52 AM
Subject: Re: [R] Panel Data Analysis


 Mihai Nica [EMAIL PROTECTED] writes:
 
  I am trying to find a package/solution for panel (longitudinal) data
  analysis. Unfortunately it seems I don't know where to start. Could
  somebody offer a hint?
 
 Analysis of longitudinal data is discussed in Pinheiro and Bates
 (2000), Mixed-effects Models in S and S-PLUS (Springer), which uses
 the nlme package.  You may also want to look at the web site for Jed
 Frees upcoming book Longitudinal and Panel Data: Analysis and
 Applications for the Social Sciences 
 http://research.bus.wisc.edu/jfrees/Book/PDataBook.htm
 
 The Statistical Code section provides examples in R as well as SAS and
 Stata.


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] saving a data.frame to \t files

2004-03-11 Thread Mihai Nica
Windows 2000, updated R and packages.

could somebody please help with saving a data.frame with column
names into \t text files for later importing in other programs? It seems an easy 
task, yet... it beats me.

thanks,

Mihai Nica
Jackson State University
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] saving a data.frame to \t files

2004-03-11 Thread Mihai Nica
many thanks to everybody... indeed it was simple, and i should have found the answer 
myself, since i DID read the R Data Import/Export manual... maybe it's the age :-)

Mihai Nica
Jackson State University
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html