Re: [R] introducing R to high school students

2012-04-21 Thread Indrajit Sengupta
Bert,   What you are saying - is a problem with people who are using Excel. It is not Excel's problem that people are sending data in an unstructured way. I agree - Excel may not be the right tool when you are doing some complicated data analysis (like for e.g. statistical modeling) - but that i

Re: [R] Return dynamic array from C to R

2012-04-21 Thread Prof Brian Ripley
On 22/04/2012 04:52, Jaimin Dave wrote: Hi Everyone, I am new to R and I am trying to return array(dynamic) from C to R. But when I print array(vector) in R it gives NA as output. When I print array in C it gives correct o/p but some how it is not returned to R. *Code in C:* void test(double *ve

Re: [R] introducing R to high school students

2012-04-21 Thread Indrajit Sengupta
Why do you think Excel is a terrible tool? In what ways have you tried to use Excel and it has failed you?   Regards, Indrajit From: Rolf Turner Cc: R-help Sent: Sunday, April 22, 2012 9:25 AM Subject: Re: [R] introducing R to high school students On 22/04/1

Re: [R] predictOMatic for regression. Please try and advise me

2012-04-21 Thread William Dunlap
> newdataMaker <- function (model = NULL, fl = NULL){ > mf <- model.frame(model) > mterms <- terms(model) > mfnames <- colnames(mf) I have not studied this carefully, but it looks like you are taking the predictor variables to be the names of the columns of the model.frame. For a form

[R] Return dynamic array from C to R

2012-04-21 Thread Jaimin Dave
Hi Everyone, I am new to R and I am trying to return array(dynamic) from C to R. But when I print array(vector) in R it gives NA as output. When I print array in C it gives correct o/p but some how it is not returned to R. *Code in C:* void test(double *vec,double *size){ vec = (double *)calloc(2

Re: [R] introducing R to high school students

2012-04-21 Thread Rolf Turner
On 22/04/12 15:29, Indrajit Sengupta wrote: 1. At school we seldom deal with lot of data - the focus is more on concepts. Excel is an excellent tool That is at best debatable, and IMHO just plain incorrect. I firmly believe that Excel is a ***TERRIBLE*** tool. and no matter how muc

Re: [R] contour algorithm

2012-04-21 Thread R. Michael Weylandt
The C implementation of the algorithm is here: http://svn.r-project.org/R/trunk/src/main/plot3d.c (grep filledcontour) but I don't see a reference other than to Ross Ihaka. Hope this helps, Michael On Sat, Apr 21, 2012 at 9:21 PM, Stoch astic wrote: > First time user, so sorry if I don't under

Re: [R] introducing R to high school students

2012-04-21 Thread Indrajit Sengupta
Chris,   Don't get me wrong - I have nothing against learning R at an early age. However, I feel at a school level, the focus should be a bit more on programming. Here are some reasons why would not recommend R at school level:   1. At school we seldom deal with lot of data - the focus is more on

Re: [R] Fwd: User defined panel functions in lattice

2012-04-21 Thread Duncan Mackay
Hi Mark Thats why I did all the examples in Sweave to pick up anything I could not understand in practice but it did not help very much It also gave me a quick reference as they are all bookmarked and are annotated Duncan At 00:01 22/04/2012, you wrote: >Hi Duncan: Don't feel bad about it. I've

Re: [R] Fwd: User defined panel functions in lattice

2012-04-21 Thread Duncan Mackay
Hi Bert Thank you for your comments. I do use latticeExtra a lot - about 50% of my graphs at the moment have useOuterStrips some involving combineLimits . Many are complicated - one I have just finished involves useOuterStrips in 8,3 (r,c) panels after http://finzi.psych.upenn.edu/R/Rhelp02/a

[R] contour algorithm

2012-04-21 Thread Stoch astic
First time user, so sorry if I don't understand protocol.. Anyway, I have created a data frame consisting of pearson's R values at various x and y coordinates and then plotted this using filled.contour. My data is similar to fMRI data except that it is a surface map reconstructed from histological

[R] Survreg

2012-04-21 Thread Val
Hi all, I am trying to run Weibull PH model in R. Assume in the data set I have x1 a continuous variable and x2 a categorical variable with two classes (0= sick and 1= healthy). I fit the model in the following way. Test=survreg(Surv(time,cens)~ x1+x2,dist="weibull") My questions are 1.

Re: [R] using "factor" to eliminate unused levels without dropping other variables

2012-04-21 Thread la mer
That did the trick! Thank you much, Richard Heiberger. -- View this message in context: http://r.789695.n4.nabble.com/using-factor-to-eliminate-unused-levels-without-dropping-other-variables-tp4577123p4577206.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Date object

2012-04-21 Thread David Winsemius
On Apr 21, 2012, at 3:49 PM, Rui Barradas wrote: Hello, Veerappa Chetty wrote HI, I have to work with data objects. I have trouble. I would like to convert date to a integer of Julian dates omitting hours, minutes etc. I tried as. Date and also as.POSIXlt, ct etc. Please help me to co

Re: [R] using "factor" to eliminate unused levels without dropping other variables

2012-04-21 Thread Richard M. Heiberger
replace the line data.subset2 <- factor(data.subset1$Sample) with data.subset1$Sample <- factor(data.subset1$Sample) I assume your intention is to change the levels of the Sample variable in the data.subset1 data.frame. On Sat, Apr 21, 2012 at 3:54 PM, Melissa Rosenkranz < melissarosenkr...@g

Re: [R] xyplot - ordering factors in graph

2012-04-21 Thread pip
Thanks very much -- View this message in context: http://r.789695.n4.nabble.com/xyplot-ordering-factors-in-graph-tp4576013p4577025.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] Date object

2012-04-21 Thread Rui Barradas
Hello, Veerappa Chetty wrote > > HI, > I have to work with data objects. I have trouble. I would like to convert > date to a integer of Julian dates omitting hours, minutes etc. I tried as. > Date and also as.POSIXlt, ct etc. > > Please help me to compute the following difference. I get an "NA"

[R] using "factor" to eliminate unused levels without dropping other variables

2012-04-21 Thread Melissa Rosenkranz
Hello, I have been banging my head against the wall trying to figure out this seemingly simple problem with no success. I'm hoping that one or some of you can help. Here is the code I am trying to use: #importing data data.file <-read.csv("/file/location", header=TRUE, sep = ",") #selecting a su

Re: [R] how to write html output (webscraped using RCurl package) into file?

2012-04-21 Thread Milan Bouchet-Valat
Le samedi 21 avril 2012 à 07:05 -0700, sagarnikam123 a écrit : > i want > "http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html",showing > information in webpage to be written in .txt file as it is(i don't want any > html tag) > i am using "RCurl" package > > >marathi<-htmlTreeParse("h

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Berend Hasselman
On 21-04-2012, at 20:20, peter dalgaard wrote: > >> >> The eigenvalues are identical upto the printed 9 digits but the eigenvectors >> appear to be quite different. >> Maybe this is what Luke meant. >> >> Berend >> > > > They look quite similar to me: > >> ev <- eigen(solve(B,A) )$vectors

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread peter dalgaard
On Apr 21, 2012, at 19:13 , Berend Hasselman wrote: > > On 21-04-2012, at 16:40, peter dalgaard wrote: > >> >> On Apr 21, 2012, at 15:22 , Luke Hartigan wrote: >> >>> Hi all, >>> >>> In my experience, using eigen to solve generalized eigenvalue / eigenvector >>> problems only gives correct l

Re: [R] xyplot - ordering factors in graph

2012-04-21 Thread Greg Snow
R works on the idea that factor level ordering is a property of the data rather than a property of the graph. So if you have the factor levels ordered properly in the data, then the graph will take care of itself. To order the levels see functions like: factor, relevel, and reorder. On Sat, Apr

Re: [R] Date object

2012-04-21 Thread David Winsemius
On Apr 21, 2012, at 1:17 PM, Veerappa Chetty wrote: HI, I have to work with data objects. I have trouble. I would like to convert date to a integer of Julian dates omitting hours, minutes etc. I tried as. Date and also as.POSIXlt, ct etc. Please help me to compute the following difference

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Berend Hasselman
On 21-04-2012, at 16:40, peter dalgaard wrote: > > On Apr 21, 2012, at 15:22 , Luke Hartigan wrote: > >> Hi all, >> >> In my experience, using eigen to solve generalized eigenvalue / eigenvector >> problems only gives correct looking eigenvalues while the eigenvectors seem >> to be wrong (in c

[R] Date object

2012-04-21 Thread Veerappa Chetty
HI, I have to work with data objects. I have trouble. I would like to convert date to a integer of Julian dates omitting hours, minutes etc. I tried as. Date and also as.POSIXlt, ct etc. Please help me to compute the following difference. I get an "NA" for output. 1/14/2006 0:00:00 AM -1/9/2006 0

Re: [R] Script Help Or Excel Add-in

2012-04-21 Thread Tal Galili
Hi Ben, 1) Have a look at: http://rcom.univie.ac.at/download.html 2) I do not know. Good luck, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Berend Hasselman
On 21-04-2012, at 17:37, Rui Barradas wrote: > Hello, > > > Berend Hasselman wrote >> >> On 21-04-2012, at 11:40, Berend Hasselman wrote: >> >>> >>> . >>> See this: >>> >>> >>> # This works on Mac OS X >>> # Change as needed for other systems >>> # or compile geigen into a standalone s

Re: [R] multi-machine parallel setup?

2012-04-21 Thread ivo welch
thx, guys, almost there. This is good fodder for the vignette or ?parallel. Steps: (1) install package "snow" on all machines which you want to be part of a cluster. (2) run under R library(parallel) cl <- makeCluster(c("localhost", "calc.localdomain"), "SOCK") result <- parLapply(cl=cl, X=1:10

Re: [R] unexpected plot behavior

2012-04-21 Thread Uwe Ligges
On 21.04.2012 16:49, Martin Renner wrote: When plotting a numerical vector against a factor, 'type="n"' seems to have no affect, e.g. plot (1:10~factor (1:10), type = "n") looks just like plot (1:10~factor (1:10)) This plots 10 boxplots and the data are passed from plot.formula. plot.fo

Re: [R] unexpected plot behavior

2012-04-21 Thread Marc Schwartz
On Apr 21, 2012, at 9:49 AM, Martin Renner wrote: > When plotting a numerical vector against a factor, 'type="n"' seems to have > no affect, e.g. >> plot (1:10~factor (1:10), type = "n") > > looks just like >> plot (1:10~factor (1:10)) > > Plotting a numerical against itself works as expected:

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Rui Barradas
Hello, Berend Hasselman wrote > > On 21-04-2012, at 11:40, Berend Hasselman wrote: > >> >> . >> See this: >> >> >> # This works on Mac OS X >> # Change as needed for other systems >> # or compile geigen into a standalone shared object. >> >> dyn.load(file.path(R.home("lib"),"libRlapack.

[R] Script Help Or Excel Add-in

2012-04-21 Thread bscully
Hello, I have been using R/S+ for years and love the software. Still a novice but I can do what i need to. Anyway, I am working on a forecasting project and would like to create a script that automates the following steps: order data by X Create groupings 1...N Separate test data set run regress

Re: [R] multi-machine parallel setup?

2012-04-21 Thread Joshua Wiley
On Sat, Apr 21, 2012 at 8:20 AM, ivo welch wrote: > hi uwe---my box is different: > > cl <- makeCluster(c("localhost", "welch", "calc"), "SOCK") > Error in loadNamespace(name) : there is no package called 'snow' > > this seems to be part of snow, not parallel.  ok, install snow first, > then rerun

[R] unexpected plot behavior

2012-04-21 Thread Martin Renner
When plotting a numerical vector against a factor, 'type="n"' seems to have no affect, e.g. > plot (1:10~factor (1:10), type = "n") looks just like > plot (1:10~factor (1:10)) Plotting a numerical against itself works as expected: > plot (1:10, type = "n") I see the same behavior under debian

Re: [R] multi-machine parallel setup?

2012-04-21 Thread Uwe Ligges
On 21.04.2012 17:20, ivo welch wrote: hi uwe---my box is different: cl<- makeCluster(c("localhost", "welch", "calc"), "SOCK") Error in loadNamespace(name) : there is no package called 'snow' this seems to be part of snow, not parallel. ok, install snow first, then rerun. No, you just need

[R] help with rmeta package

2012-04-21 Thread Luca Braglia
Dear R users, I'm trying figuring out with forest plot and rmeta. Here's my code... library(rmeta) tabletext <- structure(c("", NA, "Sex", "[F]", "[M]", NA, "Age class", "(0,60]", "(60,80]", NA, "Karnofsky class", "[70;90]",

Re: [R] multi-machine parallel setup?

2012-04-21 Thread ivo welch
hi uwe---my box is different: cl <- makeCluster(c("localhost", "welch", "calc"), "SOCK") Error in loadNamespace(name) : there is no package called 'snow' this seems to be part of snow, not parallel. ok, install snow first, then rerun. library(snow) Attaching package: 'snow' The following objec

Re: [R] ANOVA in quantreg - faulty test for 'nesting'?

2012-04-21 Thread Roger Koenker
Yes, the models are nested, and yes I probably should have been more clever about parsing formulae, for these cases. I'll have a look at the code for glm, I presume that lm() is also capable of groking this? Meanwhile, I would like to point out that any of these linear restrictions can be refor

Re: [R] hdf library for windows

2012-04-21 Thread Prof Brian Ripley
On 21/04/2012 13:30, will smith wrote: What question? Please see what the posting guide has to say about context. The question puzzled me at first, because of your use of "library". It looks as if the hdf5 r "package" utilises the "windows hdf5 library" binary. My reading is that you will hav

Re: [R] multi-machine parallel setup?

2012-04-21 Thread Uwe Ligges
On 21.04.2012 06:34, ivo welch wrote: the vignette to the library(parallel) mentions snow repeatedly (esp differences in its implementation in parallel from the original). unfortunately, it doesn't give an example or tutorial for multi-machine use with sockets. could someone please point me to

Re: [R] odbcConnectExcelpel() fails to fetch all columns

2012-04-21 Thread Andrew Roberts
Thanks for your help, I have exported the worksheet to .csv and it imports fine. I then reloaded the .csv back into Excel and ... (red face) all the columns came across. I have no idea as to what was in the Excel worksheet that tripped up RODBC. I very much take your point Jeff but I have to

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread peter dalgaard
On Apr 21, 2012, at 15:22 , Luke Hartigan wrote: > Hi all, > > In my experience, using eigen to solve generalized eigenvalue / eigenvector > problems only gives correct looking eigenvalues while the eigenvectors seem > to be wrong (in comparison to results from MATLAB's 'eig' function for > exam

[R] how to write html output (webscraped using RCurl package) into file?

2012-04-21 Thread sagarnikam123
i want "http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html",showing information in webpage to be written in .txt file as it is(i don't want any html tag) i am using "RCurl" package >marathi<-htmlTreeParse("http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html";) >marathi >

Re: [R] hdf library for windows

2012-04-21 Thread will smith
The question puzzled me at first, because of your use of "library". It looks as if the hdf5 r "package" utilises the "windows hdf5 library" binary. My reading is that you will have to compile the package yourself after you have downloaded the hdf windows dll from hdf.ncsa.uiuc.edu The instructions

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Berend Hasselman
On 21-04-2012, at 11:40, Berend Hasselman wrote: > > . > See this: > > > # This works on Mac OS X > # Change as needed for other systems > # or compile geigen into a standalone shared object. > > dyn.load(file.path(R.home("lib"),"libRlapack.dylib")) > Replacing the dyn.load line with d

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Luke Hartigan
Hi all, In my experience, using eigen to solve generalized eigenvalue / eigenvector problems only gives correct looking eigenvalues while the eigenvectors seem to be wrong (in comparison to results from MATLAB's 'eig' function for example). However, I think it is possible to solve generalized eig

Re: [R] Package "demography" - calculating percentiles of survival probabilities distribution

2012-04-21 Thread David Winsemius
On Apr 21, 2012, at 6:05 AM, jolo999 wrote: Hi David, thanks for your patience and your comment. Unfortunately, your code - if I understood it correctly - is still not what I am looking for. I try to describe an example as you suggested: I was asking for a working example (as implied by s

Re: [R] Package "demography" - calculating percentiles of survival probabilities distribution

2012-04-21 Thread jolo999
Hi David, thanks for your patience and your comment. Unfortunately, your code - if I understood it correctly - is still not what I am looking for. I try to describe an example as you suggested: I assume that the Lee-Carter-Forecast-Modell generates different sample paths or simulation runs, e.g.

[R] shape parameter in 'normalp'

2012-04-21 Thread R^2
hi, i tried to fit the GED for my sample. when doing this without the package normalp i received a shape parameter p of about 0.5, whereas 'paramp' told me that p is 1 sharp. for a leptokurtic shape p should be in a range of 0http://r.789695.n4.nabble.com/shape-parameter-in-normalp-tp4576043p45760

Re: [R] Splitting a dataframe by character vector

2012-04-21 Thread Ben Neal
Thank you Jorge. I did get subset to work on a character vector last night, the only difference being I used two equals signs: (not working) > Site1 <- subset(Cover, Site = "PtaCaracol") (working) > Site1 <- subset(Cover, Site = = "PtaCaracol") I am unsure why this is, but it worked. I believ

[R] xyplot - ordering factors in graph

2012-04-21 Thread pip
Hello - newbie Have created a lattice graph and want to know how to sort one of the elements which is a factor. The factor numbers in graph are - eg - 10 32 21 2 22 4 etc Regards -- View this message in context: http:/

Re: [R] symmetric matrix on both diagonals

2012-04-21 Thread David Winsemius
On Apr 21, 2012, at 1:13 AM, Petr Savicky wrote: On Fri, Apr 20, 2012 at 10:52:47AM -0400, David Winsemius wrote: On Apr 20, 2012, at 7:05 AM, Petr Savicky wrote: On Fri, Apr 20, 2012 at 03:03:40AM -0700, juliane0212 wrote: I'm having some problems computing a matrix being symmetric on

Re: [R] error loading tcltk2

2012-04-21 Thread Philippe Grosjean
There is indeed a bug in tcltk2, while I introduced some changes targeting a better look of Tk widgets on Ubuntu. This new code is assuming 'cat' is available on all platforms. Indeed on Windows, it *is* available iff Rtools are installed, which is the case apparently on all test machines so fa

Re: [R] Solve an ordinary or generalized eigenvalue problem in R?

2012-04-21 Thread Berend Hasselman
On 20-04-2012, at 21:18, Jonathan Greenberg wrote: > Ok, I figured out a solution and I'd like to get some feedback on this from > the R-helpers as to how I could modify the following to be "package > friendly" -- the main thing I'm worried about is how to dynamically set the > "dyn.load" stateme

Re: [R] Fwd: User defined panel functions in lattice

2012-04-21 Thread Duncan Mackay
Bert I have read Deepayan's book and done all the examples but there is no mention of panel.number and panel.groups in the books example. I just cannot get the fully meaning of what has been written regarding passing arguments to panel functions. Regards Duncan At 14:31 21/04/2012, you w

[R] Interval censorin

2012-04-21 Thread Christopher Kelvin
Hello, May i know whether it is possible to generate data twice from Weibull distribution and use one as the start time and the  other as the end time, below is my code. Any suggestion on how to estimate the parameters of Weibull distribution with interval data will be highly appreciated. Thank y

Re: [R] Problem with Tukey test

2012-04-21 Thread danipaty13
sorry i uploaded the wrong file but with the one i uploaded happens the same error, it was just as an example -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-Tukey-test-tp4573945p4575946.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Problem with Tukey test

2012-04-21 Thread danipaty13
thank you s much i just tried the code you posted and worked perfectly -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-Tukey-test-tp4573945p4575943.html Sent from the R help mailing list archive at Nabble.com. __ R-help@