Re: [R] error in mlogit

2012-06-22 Thread Kazu Nada
Thank you so much for the suggestion. I want to estimate interactions between the attributes of the choice set and subject-specific data (e.g., gender or income). However, y ~ x | z notation is to see the interaction between the alternatives of choice set and subject-specific data (e.g., gender or

[R] Creating interactive 3D graphs for embedding in pdf not possible in R?

2012-06-22 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Just to be sure: I couldn't find a way of creating an interactive 3d graph which can be embedded in a pdf - is it correct that this can not be done with R? Cheers, Rainer - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation

Re: [R] error in mlogit

2012-06-22 Thread Achim Zeileis
On Fri, 22 Jun 2012, Kazu Nada wrote: Thank you so much for the suggestion. I want to estimate interactions between the attributes of the choice set and subject-specific data (e.g., gender or income). However, y ~ x | z notation is to see the interaction between the alternatives of choice set

Re: [R] Creating interactive 3D graphs for embedding in pdf not possible in R?

2012-06-22 Thread baptiste auguie
Hi, Try this post: http://r.789695.n4.nabble.com/Exporting-an-rgl-graph-tp1872712p1905113.html HTH, b. On 22 June 2012 19:26, Rainer M Krug r.m.k...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Just to be sure: I couldn't find a way of creating an interactive 3d

Re: [R] how to make a histogram with percentage on top of each bar?

2012-06-22 Thread Deepayan Sarkar
On Thu, Jun 21, 2012 at 10:56 PM, york8866 yu_y...@hotmail.com wrote: I have a dataset like the following: ID      DV 1       0.868576818 2       0.337120116 3       0.029233775 4       0.719783525 5       0.976631182 6       0.672941605 7       0.13239462 8       0.99936475 9      

Re: [R] MGCV: Use of irls.reg option

2012-06-22 Thread r-help . 20 . trevva
Hi Simon, Thanks for taking the time to reply. Please let me explain a few more details. The problem that I am working on is essentially the same as the Bristol Channel Sole Egg distribution example in your book and in the soap paper but instead it is Herring Larvae in the English Channel - same

Re: [R] exact relative positioning of lattice plots

2012-06-22 Thread Deepayan Sarkar
On Wed, Jun 20, 2012 at 7:18 PM, John G. Bullock john.bull...@yale.edu wrote: In your actual use case, are there any annotations outside the panel (tick marks, labels, etc.)? Things would be much simpler if not (as in your example). In that case, just call the suitable panel function after

Re: [R] aligning axis labels in a colorkey from levelplot

2012-06-22 Thread Deepayan Sarkar
On Tue, Jun 19, 2012 at 10:55 PM, Stephen Eglen s.j.eg...@damtp.cam.ac.uk wrote: Justification is hard-coded, and that's not easy to change. This is not only for the colorkey; e.g.,   xyplot(y~1, scales = list(alternating = 3)) will also give you left-aligned axes on the right. My only

Re: [R] removing NA from a data frame

2012-06-22 Thread Stuart Leask
Removing rows with NAs, using na.omit(), doesn't seem to be working for me. Dataset: str ( ex10s ) 'data.frame': 2189576 obs. of 5 variables: $ LOPNR : int 58 58 58 58 64 64 64 64 64 64 ... $ DIAGNOS: Factor w/ 173 levels F20,F200,F2000,..: 128 128 128 128 105 105 105 160 105 105 ... $

[R] R 2.15.1 is released

2012-06-22 Thread Peter Dalgaard
The build system has rolled up R-2.15.1.tar.gz (codename Roasted Marshmallows) at 9:00 this morning. This is a maintenance release; see the list below for details. You can get it from http://cran.r-project.org/src/base/R-2/R-2.15.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to

Re: [R] Novice question about getting data into R

2012-06-22 Thread Petr PIKAL
Hi Dear Petr, nbsp; Thank you very much for reply. You cannot read the Chinese characters may Yes, and I cannot install it either. be because you don't have install this language. Do you have any idea how solve this problem? Or who can help me? May I install Linux? What problem?

Re: [R] removing NA from a data frame

2012-06-22 Thread Petr PIKAL
Hi both na.omit and complete cases works for me smoothly when NA is not a valid level in factor. If this is the case, as it seems to be, you need reset your factor levels so that NA is not a valid level. ex10s$dg - factor( ex10s$dg ) both commands shall work than. Regards Petr Removing

Re: [R] how to make a histogram with percentage on top of each bar?

2012-06-22 Thread Mohan Radhakrishnan
Hi, Stackoverflow had an example. Forgot the contributor's name but it shows percentages at the top. I use it as it is as I am not the expert. png(Histogram.png) pdata-read.csv(histogram.csv,header=T) histPercent - function(x, ...) { H - hist(pdata$y, plot = FALSE) H$density -

[R] Variance with confidence interval

2012-06-22 Thread Mohan Radhakrishnan
Hi, Is there a way to calculate variance directly by specifying confidence interval using R ? I am specifically asking because I wanted to investigate how this could be useful for project schedule variance calculation. Moreover I am interested in using R for monte carlo simulation as

Re: [R] removing NA from a data frame

2012-06-22 Thread Prof Brian Ripley
On 22/06/2012 09:41, Stuart Leask wrote: Removing rows with NAs, using na.omit(), doesn't seem to be working for me. It won't if NA is a level of the factor, which is what you seems to have here. For table(as.factor(c(1,2,NA))) 1 2 1 1 omits NAs by default. Dataset: str ( ex10s )

Re: [R] removing NA from a data frame

2012-06-22 Thread Peter Ehlers
On 2012-06-22 01:41, Stuart Leask wrote: Removing rows with NAs, using na.omit(), doesn't seem to be working for me. Dataset: str ( ex10s ) 'data.frame': 2189576 obs. of 5 variables: $ LOPNR : int 58 58 58 58 64 64 64 64 64 64 ... $ DIAGNOS: Factor w/ 173 levels F20,F200,F2000,..: 128

Re: [R] install package mixdist

2012-06-22 Thread Uwe Ligges
On 21.06.2012 23:34, Yakir Gagnon wrote: Hi all, I'm trying to install the mixdist package with: install.packages(mixdist) But I'm getting the following errors: * installing *source* package ‘mixdist’ ... ** R ** data ** preparing package for lazy loading ** help *** installing help

Re: [R] how to make a histogram with percentage on top of each bar?

2012-06-22 Thread Jim Lemon
On 06/22/2012 03:26 AM, york8866 wrote: I have a dataset like the following: ID DV 1 0.868576818 2 0.337120116 3 0.029233775 4 0.719783525 5 0.976631182 6 0.672941605 7 0.13239462 8 0.99936475 9 0.91540604 10 0.545686514 to get a

[R] scatter.smooth() line colour

2012-06-22 Thread r-help . 20 . trevva
Hi, I really like the scatter.smooth() function - its extremeley useful. However, as far as I understand it, there is no way to change the properties of the smoothing line e.g. col, lty, lwd. The scatter.smooth function accepts a ... argument, but these are not passed to the plotting function

Re: [R] Creating interactive 3D graphs for embedding in pdf not possible in R?

2012-06-22 Thread Duncan Murdoch
On 12-06-22 3:32 AM, baptiste auguie wrote: Hi, Try this post: http://r.789695.n4.nabble.com/Exporting-an-rgl-graph-tp1872712p1905113.html There's no more progress on U3D from me since that thread, but rgl can now export WebGL format, which is viewable in most browsers (though not IE).

[R] Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!

2012-06-22 Thread angelo.arc...@virgilio.it
Dear list members, I get the following error when using the glht function to perform a post hoc analysis for an ANOVA with repeated measures: require(nlme) lme_H2H_musicians = lme(H2H ~ Emotion*Material, data=musicians, random = ~1|Subject) require(multcomp) summary(glht(lme_H2H_musicians,

[R] comparing word with dictionary words

2012-06-22 Thread raishilpa
Hello, I am comparing each words of a paragraph with the dictionary words (I have a text file/csv file of dictionary words -dictionary.csv/dictionary.txt) and if a word is not present in the dictionary, I want to store that word in another variable . and want output showing the list of these

[R] How to plot grouped bar plot in R?

2012-06-22 Thread Manish Gupta
HI, I have one input file Alpha 0 0.625 Beta1 0.107143 Gama2 0.910714 Delta 0 0 zeta0 0 eta 0 0.089286 I want to to plot bar plot like below http://r.789695.n4.nabble.com/file/n4634182/Screenshot.png I can plot if i have input file in

Re: [R] How to plot grouped bar plot in R?

2012-06-22 Thread Jim Lemon
On 06/22/2012 07:35 PM, Manish Gupta wrote: HI, I have one input file Alpha 0 0.625 Beta1 0.107143 Gama2 0.910714 Delta 0 0 zeta0 0 eta 0 0.089286 I want to to plot bar plot like below

Re: [R] comparing word with dictionary words

2012-06-22 Thread Rui Barradas
Hello, Try something along the lines of dic - letters[1:4] para - sample(letters, 100, TRUE) ix - para %in% dic para[ !ix ]# all words unique(para[ !ix ]) # without duplicates Hope this helps, Rui Barradas Em 22-06-2012 07:45, raishilpa escreveu: Hello, I am comparing each words of

[R] Plotting linear fit

2012-06-22 Thread Van Patten, Isaac T
I am trying to plot the linear fit by id of the following data (test.l): id year incidents 1001 0 1011 1 102121 103127 1041 3 105112 1002 5 1012 5 102219 103210 1042

[R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread maxbre
Given my reproducible example myexample-structure(list(site = structure(c(4L, 2L, 2L, 4L, 2L, 4L, 4L, 3L, 1L, 3L, 1L, 1L, 3L, 4L, 5L, 2L), .Label = c(A, B, C, D, E), class = factor), obs = c(0.302, 0.956, 0.72, 1.21, 0.887, 0.728, 1.294, 20.493, 0.902, 0.031, 0.468, 2.318, 4.795, 89.581,

Re: [R] Edges and Rasters

2012-06-22 Thread Sarah Goslee
There's almost certainly a more elegant way to do it, but this works: r - raster(nrow=30, ncol=30, xmn=0) r[]-NA r[393:409]-99 r[423:439]-99 r[453:455]-99 r[456:460]-30 r[461:469]-99 r[483:499]-99 r[513:529]-99 plot(r,col=terrain.colors(100)) plot(edge(r, type=outer), col=c(transparent, black),

[R] axis in r plot

2012-06-22 Thread sathya7priya
I have a graph plotted in r.The x axis tickmarks are at 0,5,10. I need a graph with resolution of tickmarks at 0.1 interval.When i place tickmarks of 0.1 intervals using the following command axis(1, at=seq(0,5,0.1), cex.axis=0.7, las=2) I only get the tickmarks of 0.1 interval that are very

Re: [R] how to make a histogram with percentage on top of each bar?

2012-06-22 Thread york8866
Thank you all for the help, York -- View this message in context: http://r.789695.n4.nabble.com/how-to-make-a-histogram-with-percentage-on-top-of-each-bar-tp4634131p4634203.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] axis in r plot

2012-06-22 Thread Sarah Goslee
On Fri, Jun 22, 2012 at 7:51 AM, sathya7priya sathya7pr...@gmail.com wrote: I have a graph plotted in r.The x axis tickmarks are at 0,5,10. I need a graph with resolution of tickmarks at 0.1 interval.When i place tickmarks of 0.1 intervals using the following command   axis(1, at=seq(0,5,0.1),

Re: [R] Plotting linear fit

2012-06-22 Thread Rui Barradas
Hello, Try test - read.table(text= id year incidents 1001 0 1011 1 102121 103127 1041 3 105112 1002 5 1012 5 102219 103210 1042 2 105212 1003

Re: [R] Creating interactive 3D graphs for embedding in pdf not possible in R?

2012-06-22 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/06/12 13:14, Duncan Murdoch wrote: On 12-06-22 3:32 AM, baptiste auguie wrote: Hi, Try this post: http://r.789695.n4.nabble.com/Exporting-an-rgl-graph-tp1872712p1905113.html There's no more progress on U3D from me since that thread,

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread Rui Barradas
Hello, Try the following myex - myexample myex$sample - as.character(myex$sample) myex$sample - as.Date(myex$sample, format=%d/%m/%Y) myex Then, run the first attempt without bothering to order, lattice is clever and will do it for you. Hope this helps, Rui Barradas Em 22-06-2012 13:20,

Re: [R] How to plot grouped bar plot in R?

2012-06-22 Thread David L Carlson
This will get it assuming the data.frame is arranged like this DatFile - read.table(text=Name x1 x2 Alpha 00.625 Beta1 0.107143 Gama2 0.910714 Delta 0 0 zeta0 0 eta 0 0.089286, sep=, header=TRUE) rownames(DatFile) - DatFile$Name

Re: [R] scatter.smooth() line colour

2012-06-22 Thread David L Carlson
You are correct about scatter.smooth, but loess.smooth (listed along with scatter.smooth on the same help page) gives you the way to get what you want: x - rnorm(25) y - rnorm(25) plot(x, y) lines(loess.smooth(x,y), col=red, lty=2, lwd=2) -- David L

[R] Boxplot with Log10 and base-exponent axis

2012-06-22 Thread Luigi
Dear all, I would like to (i) produce boxplot graphs with axis in logarithm in base 10 and (ii) showing the values on the axis in 10^exponent format rather than 10E+exponent. To illustrate with an example, I have some widely spread data that I chart plot using boxplot() [figure on the left];

[R] R: Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!

2012-06-22 Thread angelo.arc...@virgilio.it
Hello everybody, problem solved, there was a typo. I wrote Type instead of Material Best Messaggio originale Da: angelo.arc...@virgilio.it Data: 22-giu-2012 11.05 A: r-help@r-project.org Ogg: Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s)

[R] problems with overlay of raster!

2012-06-22 Thread Carolin
Hi, I am trying to overlay to raster but I always got this warning message: test-overlay(raster1,raster2,fun=function(x,y){x*y}) Warning message: In x * y : longer object length is not a multiple of shorter object length Here are the general information about my raster layer raster1 class

Re: [R] axis in r plot

2012-06-22 Thread S Ellison
Perhaps you meant ... at=seq(0,5,1) ? S From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of sathya7priya [sathya7pr...@gmail.com] Sent: 22 June 2012 12:51 To: r-help@r-project.org Subject: [R] axis in r plot I have a graph

Re: [R] 3D version of triax.plot (package plotrix)

2012-06-22 Thread althalis
Hi everybody, I have been looking for exactly the same 3D equilateral pyramid representation in R and couldn't find an answer in all the forum discussions I've red. It's been 2 years since the last post on the subject here, did anybody find the way to make it ? Thank you, Julie -- View this

Re: [R] scatter.smooth() line colour

2012-06-22 Thread Mark Payne
Hi David, Thanks for the reply. I agree - it just seemed that it was something fairly obvious that was missing from an otherwise handy little function Would it be appropriate to file it as a request for improvement in the bug tracking system? Mark On 22 June 2012 16:30, David L Carlson -

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread maxbre
thanks for your reply but I don't think your solution can accomplish to what I need... (I can't see any ordering of the variable sample with reference to the variable obs) please keep in mind that for a numer of reasons that I do not mention here for the sake of conciseness in my case the

Re: [R] Boxplot with Log10 and base-exponent axis

2012-06-22 Thread William Dunlap
The key is to supply an expression, not text, to the labels argument to axis. See help(plotmath) for details. Here is an example: x - list(One=10^(sin(1:10)+5), Two=10^(cos(1:30)*2)) boxplot(x, log=y, yaxt=n) ylim - par(usr)[3:4] log10AtY - seq(ceiling(ylim[1]), floor(ylim[2]))

Re: [R] Boxplot with Log10 and base-exponent axis

2012-06-22 Thread William Dunlap
You might prefer placing the tick marks with log10AtY - log10(axTicks(side=2)) log10AtY - unique(round(log10AtY)) instead of the ylim - par(usr)[3:4] log10AtY - seq(ceiling(ylim[1]), floor(ylim[2])) in my original example. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread Rui Barradas
Hello, Ok, I hadn't understood. I still don't, not completely. Why do you want to order 'sample' with reference to 'obs'? It would make sense only in the case of 'obs' ties. Doesn't it make more sense to order 'sample' within 'site'? As for keeping 'sample' character it's very simple, I was

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread Rui Barradas
Sorry, missed the plot instruction. dotplot(sample[ord] ~ obs[ord] | site, data=myex, [... etc ...] Rui Barradas Em 22-06-2012 16:43, Rui Barradas escreveu: Hello, Ok, I hadn't understood. I still don't, not completely. Why do you want to order 'sample' with reference to

Re: [R] crosstable and regression for survey data (weighted)

2012-06-22 Thread Pablo Domínguez Vaselli
Regarding regression models, there's a bit of discussion on whether or not it is necessary to take the sample design into account (for instance, SPSS doesn't), so you can run them just normally without much remorse. Or get your life complicated (see below). Your xtabs call seems OK to me.

[R] Search list of elements for a specific pattern

2012-06-22 Thread Joshua Budman
Hi, I have a list of mutations, called mutList, of the form: head(mutList) Alu 1 AluJ 2 AluJ/F(R)AM 3AluJ/FLAM 4AluJ/FRAM 5 AluJ/monomer 6AluJb It contains about 500 elements and not all of them contain the sequence Alu. I tried using this code:

Re: [R] Search list of elements for a specific pattern

2012-06-22 Thread Sarah Goslee
You should use grepl() instead: Alu-mutList[grepl(Alu,mutList)] or some variant of the above, depending on the actual structure of mutList (which might be a data frame, but doesn't appear to be a generic list). str() and dput() are both very useful for asking well-formed questions. Sarah On

Re: [R] scatter.smooth() line colour

2012-06-22 Thread David Winsemius
It's really not that difficult to fix with some simple changes to the code: scatter.smooth.col - function (x, y = NULL, span = 2/3, degree = 1, family = c(symmetric, gaussian), xlab = NULL, ylab = NULL, ylim = range(y, pred$y, na.rm = TRUE), evaluation = 50, ..., lcol, llty, llwd) {

Re: [R] Search list of elements for a specific pattern

2012-06-22 Thread Bert Gunter
Yes! I'm guessing what he wants is mutList$Alu[grepl(Alu,mutList$Alu)] which can be simplified using with() to with(mutList,Alu[grepl(Alu,Alu)]) But, in the absence of dput'ted data, we can't be sure. I would also recommend that he reads up on list or data frame syntax, depending on what this

Re: [R] Search list of elements for a specific pattern

2012-06-22 Thread Sarah Goslee
On Fri, Jun 22, 2012 at 12:30 PM, Joshua Budman josh.bud...@gmail.com wrote: Hi, Thank you very much. You are correct, it is a data frame. However, the code below is still returning the full data frame. Do you have any suggestions? Thanks in advance, Josh On 22-Jun-12, at 12:22 PM, Sarah

Re: [R] 3D version of triax.plot (package plotrix)

2012-06-22 Thread David L Carlson
Look at quadplot in package klaR. -- David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On

Re: [R] Boxplot with Log10 and base-exponent axis

2012-06-22 Thread Martin Maechler
The key is to supply an expression, not text, to the labels argument to axis. See help(plotmath) for details. Here is an example: x - list(One=10^(sin(1:10)+5), Two=10^(cos(1:30)*2)) boxplot(x, log=y, yaxt=n) ylim - par(usr)[3:4] log10AtY - seq(ceiling(ylim[1]), floor(ylim[2]))

[R] Questions about doing analysis based on time

2012-06-22 Thread APOCooter
Man, R has a steep learning curve (but I suppose you all know this). I have very little programming knowledge, so when I search for answers to my questions, I struggle with making sense of a lot of the pages. I have a spreadsheet that I've read into R using read.csv. I've also attached it. It

Re: [R] Search list of elements for a specific pattern

2012-06-22 Thread arun
Hi, You could try this; dat2-read.table(text=      Alu 1    AluJ 2  AluJ/F(R)AM 3 monomer 4    AluJ/FLAM 5    AluJ/FRAM 6 AluJ/monomer 7    AluJb 8    JBF 9   FRAM ,sep=,header=TRUE)  subset(dat2,grepl(Alu,dat2$Alu))    Alu 1 AluJ 2  AluJ/F(R)AM 4    AluJ/FLAM

Re: [R] scatter.smooth() line colour

2012-06-22 Thread Martin Maechler
It's really not that difficult to fix with some simple changes to the code: scatter.smooth.col - function (x, y = NULL, span = 2/3, degree = 1, family = c(symmetric, gaussian), xlab = NULL, ylab = NULL, ylim = range(y, pred$y, na.rm = TRUE), evaluation = 50, ..., lcol, llty,

Re: [R] scatter.smooth() line colour

2012-06-22 Thread David Winsemius
On Jun 22, 2012, at 1:50 PM, Martin Maechler wrote: It's really not that difficult to fix with some simple changes to the code: scatter.smooth.col - function (x, y = NULL, span = 2/3, degree = 1, family = c(symmetric, gaussian), xlab = NULL, ylab = NULL, ylim = range(y, pred$y,

Re: [R] Questions about doing analysis based on time

2012-06-22 Thread John Kane
Hi and welcome to the R-help list. It would be much better for readers to get your data in a more easily used format. There is a function called dput() that will output your data in a way that R can read easily. We don't need to see all the data but perhaps hundred lines of it would be nice.

Re: [R] Questions about doing analysis based on time

2012-06-22 Thread R. Michael Weylandt
On Fri, Jun 22, 2012 at 2:18 PM, John Kane jrkrid...@inbox.com wrote: Hi and welcome to the R-help list. It would be much better for readers to get your data in a more easily used format. There is a function called dput() that will output your data in a way that R can read easily. We

[R] problem with loading the dynamic object(.so file) inside a R package

2012-06-22 Thread xuan zhao
I have built a R package including the C code. My question is: Can the shared object get loaded automatically as we load the R package? In my case, I have to do dyn.load(dirc/filename.so) in the R script to load the shared object, which is very inconvenient. Is there anyway to make R to load this

Re: [R] problem with loading the dynamic object(.so file) inside a R package

2012-06-22 Thread R. Michael Weylandt
I believe that useDynLib() in the NAMESPACE file should do it for you. Best, Michael On Fri, Jun 22, 2012 at 1:36 PM, xuan zhao xuan.z...@sentrana.com wrote: I have built a R package including the C code. My question is: Can the shared object get loaded automatically as we load the R package?

[R] dropping variables from a data frame inside a function

2012-06-22 Thread Joseph Boyer
Why doesn't this work? #Drop a variable name from a data frame DropLikeSAS - function(x,df) { df[[x]] - NULL 0 } DropLikeSAS(VarName, DataFrameName) Try it. The column VarName

Re: [R] Questions about doing analysis based on time

2012-06-22 Thread APOCooter
Here is a part of the data for the first two questions: head(Sunday,100) SunDate SunTime SunScore 1 5/9/2010 0:000:00 127 26/12/2011 0:000:00 125 36/15/2008 0:040:04 98 4 8/3/2008 0:070:07 118 57/24/2011 0:070:07 122 6

Re: [R] Search list of elements for a specific pattern

2012-06-22 Thread arun
Hi, You could also use grep to get the same result. Try this: dat2-read.table(text=      Alu 1    AluJ 2  AluJ/F(R)AM 3 monomer 4    AluJ/FLAM 5    AluJ/FRAM 6 AluJ/monomer 7    AluJb 8    JBF 9   FRAM ,sep=,header=TRUE) #grepl     dat3-subset(dat2,grepl(Alu,dat2$Alu))

Re: [R] dropping variables from a data frame inside a function

2012-06-22 Thread David Winsemius
On Jun 22, 2012, at 5:09 PM, Joseph Boyer wrote: Why doesn't this work? #Drop a variable name from a data frame DropLikeSAS - function(x,df) { df[[x]] - NULL 0 }

[R] Uniroot error message with in intergration

2012-06-22 Thread jeka12386
Dear all I am trying to calculate the value of n using uniroot. Here is the message I am having: Error in uniroot(integ, lower = 0, upper = 1000, n) : 'interval' must be a vector of length 2 Please would you be able to give me an indication on why I am having this error message. Many

Re: [R] dropping variables from a data frame inside a function

2012-06-22 Thread David Winsemius
On Jun 22, 2012, at 5:09 PM, Joseph Boyer wrote: DropLikeSAS - function(x,df) { df[[x]] - NULL 0 } DropLikeSAS(VarName, DataFrameName) Sorry for the blank message DropLikeSAS - function(x,df) {

[R] significance level (p) for t-value in package zelig

2012-06-22 Thread michael drescher
Dear All, I am using the zelig package on a Mac with OS X 10.6.8. Specifically, I am using the ologit to do a ordinal logistic regression for a ordered categorical dependent. The results make sense and are the same as I am getting when using ordinal regression in SPSS. So far so good. However,

[R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread Luba G
What is the difference of using 2L versus 2 as the margin argument in the apply() function? Where can I find detailed information on all of the possible margin arguments? x [,1] [,2] [1,]12 [2,]34 [3,]56 [4,]78 [5,]9 10 sqrt(apply(x, *2L*,

Re: [R] axis in r plot

2012-06-22 Thread Jim Lemon
On 06/22/2012 09:51 PM, sathya7priya wrote: I have a graph plotted in r.The x axis tickmarks are at 0,5,10. I need a graph with resolution of tickmarks at 0.1 interval.When i place tickmarks of 0.1 intervals using the following command axis(1, at=seq(0,5,0.1), cex.axis=0.7, las=2) I only get

Re: [R] 3D version of triax.plot (package plotrix)

2012-06-22 Thread Jim Lemon
On 06/23/2012 12:27 AM, althalis wrote: Hi everybody, I have been looking for exactly the same 3D equilateral pyramid representation in R and couldn't find an answer in all the forum discussions I've red. It's been 2 years since the last post on the subject here, did anybody find the way to

Re: [R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread Rui Barradas
Hello, 2L is an integer, 2 might be or not. In the case of apply(), there is no difference. All possible values for margin? Any possible(*) combination of the dimensions of 'x' in apply(x, margin, function) (*) non-null. If, say, x - array(0, dim=c(2,3,4)) (3dim) then you can call any of

Re: [R] dropping variables from a data frame inside a function

2012-06-22 Thread R. Michael Weylandt
I think the OP might also be tripped up on the fact that R is pass-by-value so effects on df inside DropLikeSAS won't have impact outside the function's scope. The df inside of DropLikeSAS() is changed as expected, but that has no effect on the df outside that function. To the OP: There are ways

Re: [R] dropping variables from a data frame inside a function

2012-06-22 Thread Duncan Murdoch
On 12-06-22 5:09 PM, Joseph Boyer wrote: Why doesn't this work? David gave you a solution that works. The answer to this question is that unlike SAS, R is a computing language that has an idea of variable scoping: when you modify the argument df in DropLikeSAS, you are making local

Re: [R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread R. Michael Weylandt
On Fri, Jun 22, 2012 at 5:53 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, 2L is an integer, 2 might be or not. In the case of apply(), there is no difference. All possible values for margin? Any possible(*) combination of the dimensions of 'x' in apply(x, margin, function) (*)

Re: [R] Uniroot error message with in intergration

2012-06-22 Thread R. Michael Weylandt
On Fri, Jun 22, 2012 at 4:00 PM, jeka12386 jeka12...@hotmail.co.uk wrote: Dear all I am trying to calculate the value of n using uniroot.  Here is the message I am having: Error in uniroot(integ, lower = 0, upper = 1000, n) :  'interval' must be a vector of length 2 Please  would you

Re: [R] Variance with confidence interval

2012-06-22 Thread R. Michael Weylandt
On Fri, Jun 22, 2012 at 5:13 AM, Mohan Radhakrishnan moh...@fss.co.in wrote: Hi,      Is there a way to calculate variance directly by specifying confidence interval using R ? I am specifically asking because I wanted to investigate how this could be useful for project schedule variance

Re: [R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread Rui Barradas
Right, I had missed that one. To the op: what Michael is saying can be shown with the following example. x - array(1:24, c(2,3,4)) r1 - apply(x, -1, sum) # remove dim 1 r2 - apply(x, 2:3, sum) # include dims 2 and 3 all.equal(r1, r2) # FALSE, different attributes all(r1 == r2) # TRUE,

Re: [R] Uniroot error message with in intergration

2012-06-22 Thread jeka12386
I have defined t at the beginning of my query. I have added n on uniroot below and still getting the same error message uniroot(integ,lower=0,upper=1000,n) -- View this message in context: http://r.789695.n4.nabble.com/Uniroot-error-message-with-in-intergration-tp4634247p4634264.html Sent

Re: [R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread Luba G
Thanks Rui! I was not aware that *number*L is an alternate to as.integer(*number*). Luba On Fri, Jun 22, 2012 at 3:53 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, 2L is an integer, 2 might be or not. In the case of apply(), there is no difference. All possible values for margin? Any

Re: [R] Uniroot error message with in intergration

2012-06-22 Thread S Ellison
Error in uniroot(integ, lower = 0, upper = 1000, n) : 'interval' must be a vector of length 2 Please would you be able to give me an indication on why I am having this error message. Because uniroot has a second parameter called 'interval' which overrides lower and upper and you have

Re: [R] significance level (p) for t-value in package zelig

2012-06-22 Thread Özgür Asar
Michael, Try ?pt Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/significance-level-p-for-t-value-in-package-zelig-tp4634252p4634271.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] significance level (p) for t-value in package zelig

2012-06-22 Thread Bert Gunter
This advice is almost certainly false! A t-statistic can be calculated, but the distribution will not necessarily be student's t nor will the df be those of the rse. See, for example, rlm() in MASS, where values of the t-statistic are given without p values. If Brian Ripley says that p values

Re: [R] apply() function: margin argument: 2L versus 2

2012-06-22 Thread Bert Gunter
FYI below. On Fri, Jun 22, 2012 at 4:00 PM, Luba G lubaglouk...@gmail.com wrote: Thanks Rui! I was not aware that *number*L is an alternate to as.integer(*number*). Luba identical(2,as.integer(2)) [1] FALSE identical(2L,as.integer(2)) [1] TRUE Cheers, Bert On Fri, Jun 22, 2012 at