[R] question

2012-02-15 Thread Maryam Farhadi
Dear Sir/Madam it is my the first time in using R-help center. I would like to know how can I install DEA package on my R program. moreover, is there any example of using R for calculating Malmquist? and should I necessarily install DEA package for that reason? I have some problems in importing my

Re: [R] question

2012-02-15 Thread R. Michael Weylandt
1) The DEA package appears to have been removed from CRAN in 2008, so it is not likely to be readily available. Old versions are available from the CRAN archives though but I don't imagine you'll get much support if you try to use them: ftp://cran.r-project.org/pub/R/src/contrib/Archive/DEA/ 2)

Re: [R] question

2012-02-15 Thread David Winsemius
On Feb 15, 2012, at 7:19 AM, R. Michael Weylandt wrote: Sorry about that -- forgot the case where you might only have a certain entry once: try this, sapply(split(GS, rownames(GS)), function(x) colSums(as.matrix(x))) or sapply(split(GS, rownames(GS)), function(x) if(is.matrix(x))

Re: [R] question

2012-02-15 Thread R. Michael Weylandt
But that's dropping unused factor levels, not the drop of `[` Michael On Wed, Feb 15, 2012 at 9:16 AM, David Winsemius dwinsem...@comcast.net wrote: On Feb 15, 2012, at 7:19 AM, R. Michael Weylandt wrote: Sorry about that -- forgot the case where you might only have a certain entry once:

Re: [R] question

2012-02-15 Thread peter dalgaard
On Feb 15, 2012, at 15:17 , R. Michael Weylandt wrote: But that's dropping unused factor levels, not the drop of `[` Is there a good reason that nobody has suggested looking at aggregate()? There would seem to be a little red tape to sort out, but, I mean, this is generally speaking what

Re: [R] Question scatterplot axis cut point

2012-02-14 Thread Jim Lemon
On 02/14/2012 06:19 AM, Michael Methlagl wrote: Hi everybody, i made a scatterplot using the command plot (datafile1, xlim=c(0,10), ylim=c(0.001, 1), log=y, xlab=x Achse, ylab=y Achse, frame.plot=FALSE, axes = TRUE). Now i have a problem. There is a gap between the x and the y axis. I want

[R] question

2012-02-14 Thread Soheila Khodakarim
I have this matrix in R, s1 s2 s3 s4 g1 1 0 0 0 g1 0 1 0 0 g1 0 0 1 0 g2 1 0 0 0 g2 0 1 0 0 g3 1 0 0 0 g4 0 0 1 0 g4 1 0 0 0 g4 0 1 0 0 g4 0 0 0 1 I want to split this matrix based on its rows then sum based on columns, finally I want to make this

Re: [R] question

2012-02-14 Thread R. Michael Weylandt
Perhaps something (untested) like sapply(split(x, rownames(x)), colSums) Next time it's suggested you use dput() to send your data. Michael On Tue, Feb 14, 2012 at 7:08 AM, Soheila Khodakarim lkhodaka...@gmail.com wrote: I have this matrix in R,   s1 s2 s3 s4 g1  1  0  0  0 g1  0  1  0  

[R] Question scatterplot axis cut point

2012-02-13 Thread Michael Methlagl
Hi everybody, i made a scatterplot using the command plot (datafile1, xlim=c(0,10), ylim=c(0.001, 1), log=y, xlab=x Achse, ylab=y Achse, frame.plot=FALSE, axes = TRUE). Now i have a problem. There is a gap between the x and the y axis. I want that the x and y axis cut at 0 and 0.001 without

[R] R-question about html writer: hwriter; how to create scroll for matrices?

2012-02-10 Thread Bornhauser Hanspeter
Dear All This is the first time I use this help forum. My apologies in case I did not follow a predefined format. My question: I use the package hwriter. How can I produce a matrix (html) that allows scrolling (up and down, left and right) or, alternatively, prduces a fixed row for the

[R] Question about measurment invariance in a multigroup SEM

2012-02-09 Thread Paul Miller
Hello All, I have a question about measurement invariance in a multigroup SEM. I am of the impression that one cannot test the equality of structural paths across groups without demonstrating measurement invariance of latent factors first. At a minimum, this would involve demonstrating that

[R] question of merging two dataframes

2012-01-31 Thread freezhu8
Suppose I have two data frames A and B A has three variables and B also has three variables. I would like to merge these two database but the requirement to merge is that the value of the second column in database A is less than the value of the second column in database B. Is there a R code to do

Re: [R] question of merging two dataframes

2012-01-31 Thread Tal Galili
Hi there, The command for merging is: merge Can you please clarify by which variable you wish to merge by? Can you maybe use ?dput function in order to give a self contained R code example of your data - and the output you wish to get? Best, Tal Contact

Re: [R] question of merging two dataframes

2012-01-31 Thread Bert Gunter
On Tue, Jan 31, 2012 at 2:24 PM, Tal Galili tal.gal...@gmail.com wrote: Hi there, The command for merging is: merge A fortunes candidate? -- Bert Can you please clarify by which variable you wish to merge by? Can you maybe use ?dput function in order to give a self contained R code

[R] question on simple graph

2012-01-31 Thread Rebecca Lisi
I am having trouble generating a graph. I want to know the % of respondents who answered that they strongly agree or agree the America owes R's ethnic group a better chance (BTTRCHNC) and I want to organize it by racial group (RACESHRT). BTTRCHNC is organized ordinally from 1 through 5 with

Re: [R] question on simple graph

2012-01-31 Thread Christopher W. Ryan
Without knowing more about what you are trying to accomplish, and what you have tried so far (code) it's difficult to say. But I'll venture this: are you sure you need a graph? Seems like a table might suffice. BT - sample(1:5, 50, replace=TRUE) RA - sample(1:5, 50, replace=TRUE) table(BT)

Re: [R] question on simple graph

2012-01-31 Thread Jim Lemon
On 02/01/2012 08:13 AM, Rebecca Lisi wrote: I am having trouble generating a graph. I want to know the % of respondents who answered that they strongly agree or agree the America owes R's ethnic group a better chance (BTTRCHNC) and I want to organize it by racial group (RACESHRT). BTTRCHNC is

Re: [R] question on model.matrix

2012-01-30 Thread Paul Johnson
Greetings On Sat, Jan 28, 2012 at 2:43 PM, Daniel Negusse daniel.negu...@my.mcphs.edu wrote: while reading some tutorials, i came across this and i am stuck. i want to understand it and would appreciate if anyone can tell me. design - model.matrix(~ -1+factor(c(1,1,2,2,3,3))) can

[R] question on model.matrix

2012-01-29 Thread Daniel Negusse
I am new to this group - joined today. I am in because i have an assignment to do using R = microarray analysis using affy (bioconductor). while reading some tutorials, i came across this and i am stuck. i want to understand it and would appreciate if anyone can tell me. design -

[R] question about ... questions/ code

2012-01-29 Thread Nicole Marie Ford
Hello, I have a dataset which I am calling RB09. I am trying to match the questions in the code book with variable codes. It is not very intuitive. example: names(RB09) [1] ea1eaf1 eaf1a eaf2 eaf2_7 [6] eaf3 eafimpun eafunpun evimpmar evfutpro

Re: [R] question about ... questions/ code

2012-01-29 Thread R. Michael Weylandt
Perhaps I'm misunderstanding you, but it doesn't sound like this is much of an R question at all: what is the code book? If it's an actual (dead tree) book, I don't think there's much you can do in R to automate identifications; if it's an online API, you *might* be able to rig a matching

Re: [R] question about ... questions/ code

2012-01-29 Thread R. Michael Weylandt
- Original Message - From: R. Michael Weylandt michael.weyla...@gmail.com To: Nicole Marie Ford nmf...@uwm.edu Cc: r-help r-help@r-project.org Sent: Sunday, January 29, 2012 9:51:37 PM Subject: Re: [R] question about ... questions/ code Perhaps I'm misunderstanding you, but it doesn't

[R] Question

2012-01-24 Thread Taylor, Brian
We were looking at conducting a pilot program with Dell to virtualize our lab environments. We are specifically looking at Dell/Citrix provisioning servers. The OS in this setup is streamed from the server on every boot. I was curious if the R Project had any licensing stipulations in this

Re: [R] Question

2012-01-24 Thread Marc Schwartz
On Jan 24, 2012, at 11:17 AM, Taylor, Brian wrote: We were looking at conducting a pilot program with Dell to virtualize our lab environments. We are specifically looking at Dell/Citrix provisioning servers. The OS in this setup is streamed from the server on every boot. I was curious

Re: [R] question re. package playwith not able to run command getting error message that I'm attempting to use non function

2012-01-20 Thread R. Michael Weylandt
Hcan you give session info (after loading playwith)? I'm able to get that code to work...also -- can you get the basic RGtk functions (like gwindow() ) to work? Michael On Thu, Jan 19, 2012 at 5:28 PM, Farhat Maha mar...@gmail.com wrote: Hello, I managed to install playwith package and

Re: [R] question re. package playwith not able to run command getting error message that I'm attempting to use non function

2012-01-20 Thread Farhat Maha
Thanks for your reply Michael, gwindow() command does work. and here is my sessionInfo gwindow() guiWidget of type: gWindowRGtk for toolkit: guiWidgetsToolkitRGtk2 *(opens a window)* sessionInfo() R version 2.14.1 (2011-12-22) Platform: i486-pc-linux-gnu (32-bit) locale: [1]

Re: [R] question re. package playwith not able to run command getting error message that I'm attempting to use non function

2012-01-20 Thread R. Michael Weylandt
I can't replicate the problem on my system (OS X) and I don't know enough about the Gtk + tcltk frameworks to help diagnose it outside of R -- it might be worth working up a minimal (non-)working example along the lines of: michaelweylandt$ R --vanilla library(playwith) playwith(plot(1:10))

[R] question re. package playwith not able to run command getting error message that I'm attempting to use non function

2012-01-19 Thread Farhat Maha
Hello, I managed to install playwith package and all its prerequisites. My R version is R 2.14: R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) All my packages were updated, and recently

Re: [R] question: how to select a column from a dataframe in a function

2012-01-17 Thread Petr PIKAL
Hi Hi, I am creating a function and ran into the problem of selecting a column from a dataset. It seems as though the $ function (as in data$columnname) does not apply in the function. In simplified version: This works: testf2-function(data,columnnumber){print(data[,columnnumber])}

[R] question: how to select a column from a dataframe in a function

2012-01-13 Thread Julia Burggraaf
Hi, I am creating a function and ran into the problem of selecting a column from a dataset. It seems as though the $ function (as in data$columnname) does not apply in the function. In simplified version: This works: testf2-function(data,columnnumber){print(data[,columnnumber])} But this

Re: [R] question: how to select a column from a dataframe in a function

2012-01-13 Thread R. Michael Weylandt
Just put the columnname variable into the brackets as well: they accept strings. As a general rule, always use the brackets (single or double) when programming: `$` has some great features for interactive use but can bite if you're not careful. Michael On Fri, Jan 13, 2012 at 5:34 PM, Julia

[R] question about R 2.15.0

2012-01-10 Thread Wang, Jing
Dear Sir/Madam, I want to download R development version 2.15.0 source code. But I just found the version for windows and MacOS. So would you please give me some instruction about how can I download the R 2.15.0 source code? Thank you very much for you help! Best, Jing Wang

Re: [R] question about R 2.15.0

2012-01-10 Thread Duncan Murdoch
On 10/01/2012 11:31 AM, Wang, Jing wrote: Dear Sir/Madam, I want to download R development version 2.15.0 source code. But I just found the version for windows and MacOS. So would you please give me some instruction about how can I download the R 2.15.0 source code? Thank you very much for

Re: [R] question about rev

2012-01-06 Thread Petr PIKAL
Hi [R] question about rev Hi,all: I have a vector,and wanna get the opposite value via rev function. a [1] FALSE FALSE TRUE TRUE TRUE rev(a) [1] TRUE TRUE TRUE FALSE FALSE I don't know why the 3rd TRUE has not been reversed,while all other values are reversed

Re: [R] question about rev

2012-01-06 Thread 孟欣
Yes£¬I find out later. rev is only reverse the order. What I use is ! Thanks At 2012-01-06 16:07:11,Petr PIKAL petr.pi...@precheza.cz wrote: Hi [R] question about rev Hi,all: I have a vector,and wanna get the opposite value via rev function. a [1] FALSE FALSE TRUE TRUE

Re: [R] question about rev

2012-01-06 Thread cvez
the function /rev / REVERSEs the order of the vector, as v= c(1,2,3) rev(v)= 3,2,1 if you want the opposite value , just add a exclamation in front of the vector: v=c(T,F,T,T); !v is F,T,F,F -- View this message in context: http://r.789695.n4.nabble.com/question-about-rev-tp4268518p4268716.html

[R] question about rev

2012-01-05 Thread 孟欣
Hi,all: I have a vector,and wanna get the opposite value via rev function. a [1] FALSE FALSE TRUE TRUE TRUE rev(a) [1] TRUE TRUE TRUE FALSE FALSE I don't know why the 3rd TRUE has not been reversed,while all other values are reversed? Thanks My best [[alternative

[R] Question about escapes character in args parameter of the system2 function.

2011-12-14 Thread Xiaobo Gu
Hi, I am trying to use the system2 function to execute external applications(actually it is psql) inside R 2.14.0 on X64 Windows, but the psql command has escape character inside it's full command line, can you help to figure out the correct parameters for the system2 function, The working

[R] Question about multiple histogram

2011-12-12 Thread Guido Leoni
Dear list I have a matrix such as the following: 1 0,5 1 0.7 1 0.5 2 1 3 0 4 0.2 I'd like to plot the histogram of the first column (this is very easy) and then for each bin of the obtained histogram to plot another histogram on the z-axis of the frequencies of the second column for the values

[R] question about fixed and random factors in aov

2011-12-12 Thread Szymek Drobniak
Dear R users, I know that it was considered many times but having searched through dozens of posts I have only added to my confusion. My question is - is it possible to correctly analyse simple mixed (fully)crossed (factorial) 2-way ANOVA? Assume we have factor A (fixed) and B (random). In the

[R] Question about fitting seasonal ARIMA in R?

2011-12-11 Thread Michael
Hi all, I just couldn't find a R function which can fit multiple seasonal patters... i.e. in the following code: *arima(x = data, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period = S), ... *** * there can be only one period, am I right? What if the data seem to have three

Re: [R] Question about fitting seasonal ARIMA in R?

2011-12-11 Thread Michael
sorry for the re-post... On Sun, Dec 11, 2011 at 8:22 PM, Michael comtech@gmail.com wrote: Hi all, I just couldn't find a R function which can fit multiple seasonal patters... i.e. in the following code: *arima(x = data, order = c(p, d, q), seasonal = list(order = c(P, D, Q), period

Re: [R] question about spaces in r

2011-12-11 Thread Petr PIKAL
Hi First of all, it's R, not r, and on this mailing list people care about this kind of thing. Second, you will need to provide more information in order to get better help. Please read the posting guide. There are a number of introductory level documents available via CRAN, please

[R] Question about comparison of nested models and F-statistics

2011-12-10 Thread олег ---
Hello, I have a linear model with 10 regressors, and summary() gives me F-statistics. After deleting a term with smallest p-value the new model was obtained with F-statistics higher then it was for full model. Does this mean that parsimonius model is better? The distributions of dependent variable

Re: [R] Question about comparison of nested models and F-statistics

2011-12-10 Thread Bert Gunter
This is not a statistical help list. Post to stats.stackexchange.com or a similar list to have someone tutor you in regression and explain why what you are doing is likely to produce utter nonsense. Or, better yet, get local statistical help in person. You also clearly need to do some reading on

[R] question about spaces in r

2011-12-09 Thread Matt Spitzer
Hello, I would like to please ask if someone would explain how r reads characters and numbers differently. Using read.csv, I had a matrix that resembled the following, only with many more ids and data: ID Visit variable 2 1 5 2 1 3 2 3 4 2 41 1 2 42 34 2 5 54 2 9 1 2

Re: [R] question about spaces in r

2011-12-09 Thread MacQueen, Don
First of all, it's R, not r, and on this mailing list people care about this kind of thing. Second, you will need to provide more information in order to get better help. Please read the posting guide. There are a number of introductory level documents available via CRAN, please pick one and

Re: [R] question about plsr() results

2011-12-02 Thread Bjørn-Helge Mevik
Vytautas Rakeviius vytautas1...@yahoo.com writes: But still I have question about results interpretation. In the end I want to construct prediction function in form: Y=a1x1+a2x2 The predict() function does the prediction for you. If you want to construct the prediction _equation_, you can

[R] question about plsr() results

2011-12-01 Thread Vytautas Rakeviius
Hi, With some help I learned how to use plsr(Y~x, 2, data=my) function in R (and build my from vector Y and matrix x). But still I have question about results interpretation. In the end I want to construct prediction function in form: Y=a1x1+a2x2 But I do not understand how to do it.

Re: [R] Question about randomForest

2011-11-28 Thread Liaw, Andy
-project.org Subject: Re: [R] Question about randomForest Matthew, Your intepretation of calculating error rates based on the training data is incorrect. In Andy Liaw's help file err.rate-- (classification only) vector error rates of the prediction on the input data, the i-th element being

Re: [R] Question about randomForest

2011-11-27 Thread Matthew Francis
Thanks for the help. Let me explain in more detail how I think that randomForest works so that you (or others) can more easily see the error of my ways. The function first takes a random sample of the data, of the size specified by the sampsize argument. With this it fully grows a tree resulting

Re: [R] Question about randomForest

2011-11-27 Thread Ken
I am pretty sure that when each tree is fitted the error rate for tree 'i' is it's performance on the data which was not used to fit the ith tree (OOB). In this way cross validation is performed for each tree but I do not think that all trees fitted prior are involved in the computation of that

Re: [R] Question about randomForest

2011-11-27 Thread Weidong Gu
Matthew, Your intepretation of calculating error rates based on the training data is incorrect. In Andy Liaw's help file err.rate-- (classification only) vector error rates of the prediction on the input data, the i-th element being the (OOB) error rate for all trees up to the i-th. My

[R] Question about randomForest

2011-11-26 Thread Matthew Francis
I've been using the R package randomForest but there is an aspect I cannot work out the meaning of. After calling the randomForest function, the returned object contains an element called prediction, which is the prediction obtained using all the trees (at least that's my understanding). I've

Re: [R] Question about randomForest

2011-11-26 Thread Weidong Gu
Hi Matthew, The error rate reported by randomForest is the prediction error based on out-of-bag OOB data. Therefore, it is different from prediction error on the original data since each tree was built using bootstrap samples (about 70% of the original data), and the error rate of OOB is likely

Re: [R] Question on density values obtained from kde2d() from package MASS

2011-11-24 Thread Prof Brian Ripley
On Thu, 24 Nov 2011, Andreas Klein wrote: Hello, I am a little bit confused regarding the density values obtained from the function kde2d() from the package MASS because the are not in the intervall [0,1] as I would expect them to be. Here is an Your expectation is wrong. example: x -

[R] Question on density values obtained from kde2d() from package MASS

2011-11-24 Thread Andreas Klein
Hello, I am a little bit confused regarding the density values obtained from the function kde2d() from the package MASS because the are not in the intervall [0,1] as I would expect them to be. Here is an example: x -

[R] Question about package installation

2011-11-18 Thread Roger Coupal
Hi, I am working with R on a Mac. I need to use a couple of packages that I found on the Web site. I install them using Packages and Data: Package Manager. I leave R and come back another time and the installed packages are not installed. So I do it again. Not a big deal, but is there anyway to

Re: [R] Question about package installation

2011-11-18 Thread R. Michael Weylandt michael.weyla...@gmail.com
I don't really know about the second half of your email, but are you sure you don't just need to reload the packages with the library() command rather than reinstalling them? It's also to set up autoload: google Rprofile for instructions. Michael On Nov 18, 2011, at 3:52 PM, Roger Coupal

Re: [R] Question about package installation

2011-11-18 Thread David Winsemius
On Nov 18, 2011, at 3:52 PM, Roger Coupal wrote: Hi, I am working with R on a Mac. I need to use a couple of packages that I found on the Web site. I install them using Packages and Data: Package Manager. I leave R and come back another time and the installed packages are not installed.

[R] Question regarding Kruskal-Wallis test

2011-11-15 Thread syrvn
Hello, I need to analyse an experiment with 3 groups: Control group Treated group 1 (drug 1) Treated group 2 (drug 2) If I use a Kruskal-Wallis test do analyse the data and if I define the control group as the reference group does the test do then the following comparisons? Control group vs.

Re: [R] Question about linear regression in R

2011-11-15 Thread David Winsemius
On Nov 14, 2011, at 10:49 PM, Miles Yang wrote: Hi all, I wrote a r program as below: x - 1:10 y - c(3,3,3,3,3,3,3,3,3,3) fit - lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because y is constant. But, I got the message as below: You are asking R to tell

Re: [R] Question about linear regression in R

2011-11-15 Thread John Fox
-project.org Subject: [R] Question about linear regression in R Hi all, I wrote a r program as below: x - 1:10 y - c(3,3,3,3,3,3,3,3,3,3) fit - lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because y is constant. But, I got the message as below

Re: [R] Question on exercise

2011-11-15 Thread Ben Bolker
Jan Kraner jan.kraner at gmx.ch writes: Dear Sir/Madam: Could you please help me with this exercise and how I could solve it in R?: Attachment (PastedGraphic-1.pdf): application/pdf, 84 KiB I especially have problems with the selection of the 40 datasets, once taken the 110 (because

Re: [R] Question on exercise

2011-11-15 Thread R. Michael Weylandt michael.weyla...@gmail.com
Copying David W from another thread: We don't do homework here. In fact, your instructor is probably watching. That said, try googling or, even better, using the rseek search. (Or even better-er RSiteSearch() in your terminal) Michael On Nov 15, 2011, at 4:16 PM, Jan Kraner jan.kra...@gmx.ch

[R] Question about linear regression in R

2011-11-14 Thread Miles Yang
Hi all, I wrote a r program as below: x - 1:10 y - c(3,3,3,3,3,3,3,3,3,3) fit - lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because y is constant. But, I got the message as below: summary(fit) Call: lm(formula = log(y) ~ x) Residuals: Min 1Q

Re: [R] Question about linear regression in R

2011-11-14 Thread R. Michael Weylandt
What exactly is it that's worrying you? It's a problematic regression for a few reasons, but ultimately it seems pretty ok, though I'd be ever so slightly worried about the R^2 value being misinterpreted. Michael On Mon, Nov 14, 2011 at 10:49 PM, Miles Yang miles2y...@gmail.com wrote: Hi all,

[R] Question

2011-11-08 Thread Parida, Mrutyunjaya
Hi My name is Rocky and I am trying to use the org.Dm.eg.db library. When I am using the org.Dm.egFLYBASE2EG[fb_ids] it is stopping at a point where it cannot find any value for a given ID such as the following: Error in .checkKeys(value, Rkeys(x), x@ifnotfound) : value for FBgn0004461 not

Re: [R] Question

2011-11-08 Thread David Winsemius
I suspect you are lost. This is almost certainly more appropriate on the BioConductor list. There are relatively few people on this list who will know what (un-named) packages you might be using. Read the Posting Guide, note the link to the Bioconductor mailing list page, configure your

[R] Question about R mantissa and number of bits

2011-11-08 Thread Lafaye de Micheaux
Dear all, I think that every number x in R can be represented in floating point arithmetic as: x = (-1)^s (1+f) 2^(e-1023) where s is coded on 1 bit, e (positive integer) is coded on 11 bits, and f (real in [0,1)) is coded on 52 bits. Am I right? We have f=\sum_{i=1}^{52} k_i 2^{-i} for

Re: [R] Question about R mantissa and number of bits

2011-11-08 Thread Nordlund, Dan (DSHS/RDA)
, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Lafaye de Micheaux Sent: Tuesday, November 08, 2011 10:49 AM To: r-help@r-project.org Subject: [R] Question

[R] Question about Calculation of Cross Product

2011-11-03 Thread 阮铮
The function of crossprod in R puzzled me. I would like to calculate the cross product of two vectors. According to my text book, it defines like this: a = (ax, ay, az) b = (bx, by, bz) then, the cross product of a and b is: a X b = (ay*bz-az*by, az*bx-ax*bz, ax*by-ay*bz) It can also write in a

Re: [R] Question about Calculation of Cross Product

2011-11-03 Thread R. Michael Weylandt
Try library(pracma) ? cross Michael Weylandt On Thu, Nov 3, 2011 at 1:17 AM, 阮铮 rz1...@foxmail.com wrote: The function of crossprod in R puzzled me. I would like to calculate the cross product of two vectors. According to my text book, it defines like this: a = (ax, ay, az) b = (bx, by,

Re: [R] Question about Calculation of Cross Product

2011-11-03 Thread Jeff Newmiller
The crossprod function in base R implements the MATRIX cross product, more familiarly known as matrix multiplication. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go...

Re: [R] Question about Calculation of Cross Product

2011-11-03 Thread Rolf Turner
On 04/11/11 11:30, Jeff Newmiller wrote: The crossprod function in base R implements the MATRIX cross product, more familiarly known as matrix multiplication. The term crossprod is thereby rather misleading, nicht wahr? Wouldn't it be *nice* to put into the help file a wee warning telling

Re: [R] Question on estimating standard errors with noisy signals using the quantreg package

2011-11-01 Thread Thorsten Vogel
21:24 An: Thorsten Vogel Cc: r-help@r-project.org help Betreff: Re: [R] Question on estimating standard errors with noisy signals using the quantreg package On Oct 31, 2011, at 7:30 AM, Thorsten Vogel wrote: Dear all, My question might be more of a statistics question than a question on R

[R] Question on estimating standard errors with noisy signals using the quantreg package

2011-10-31 Thread Thorsten Vogel
Dear all, My question might be more of a statistics question than a question on R, although it's on how to apply the 'quantreg' package. Please accept my apologies if you believe I am strongly misusing this list. To be very brief, the problem is that I have data on only a random draw, not all

Re: [R] Question on estimating standard errors with noisy signals using the quantreg package

2011-10-31 Thread Roger Koenker
On Oct 31, 2011, at 7:30 AM, Thorsten Vogel wrote: Dear all, My question might be more of a statistics question than a question on R, although it's on how to apply the 'quantreg' package. Please accept my apologies if you believe I am strongly misusing this list. To be very brief, the

Re: [R] question R regarding consecutive numbers

2011-10-28 Thread Samir Benzerfa
(1,3,4,9,1,9,1,5,4,5,2,1,1,1,6) Any ideas how to solve this problem? Cheers, S.B. -Ursprüngliche Nachricht- Von: David Winsemius [mailto:dwinsem...@comcast.net] Gesendet: Donnerstag, 27. Oktober 2011 16:44 An: Duncan Murdoch Cc: Samir Benzerfa; r-help@r-project.org Betreff: Re: [R] question R regarding

Re: [R] question R regarding consecutive numbers

2011-10-28 Thread William Dunlap
-project.org Subject: Re: [R] question R regarding consecutive numbers In the general case, there is still a gap in your solution sum( tbl[1, 2:ncol(tbl)] ). This solution refers to a specific column number (here: column number 2) and not to the actual length of the run, doesn't

Re: [R] question R regarding consecutive numbers

2011-10-28 Thread David Winsemius
-project.org ] On Behalf Of Samir Benzerfa Sent: Friday, October 28, 2011 12:35 AM To: 'David Winsemius'; 'Duncan Murdoch' Cc: r-help@r-project.org Subject: Re: [R] question R regarding consecutive numbers In the general case, there is still a gap in your solution sum( tbl[1, 2:ncol(tbl

[R] question R regarding consecutive numbers

2011-10-27 Thread Samir Benzerfa
Hi everyone Do you know about any possibility in R to check for consecutive numbers in vectors? That is, I do not only want to count the number of observations in total (which can be done table(x)), but I also want to count for instance how many times that vector contains a certain number

Re: [R] question R regarding consecutive numbers

2011-10-27 Thread Duncan Murdoch
On 27/10/2011 8:43 AM, Samir Benzerfa wrote: Hi everyone Do you know about any possibility in R to check for consecutive numbers in vectors? That is, I do not only want to count the number of observations in total (which can be done table(x)), but I also want to count for instance how many

Re: [R] question R regarding consecutive numbers

2011-10-27 Thread David Winsemius
On Oct 27, 2011, at 9:21 AM, Duncan Murdoch wrote: On 27/10/2011 8:43 AM, Samir Benzerfa wrote: Hi everyone Do you know about any possibility in R to check for consecutive numbers in vectors? That is, I do not only want to count the number of observations in total (which can be done

[R] Question about .Fortran in glmnet package

2011-10-26 Thread Axel Urbiz
Hi, My apologies for asking this question, but could not find the answer elsewhere. I understand the glmnet package uses Fortran code. For example, the lognet.R file includes the lines of code shown below. But how can I see the Fortran code that is being referenced in the code below? Is that

Re: [R] Question about .Fortran in glmnet package

2011-10-26 Thread R. Michael Weylandt
It's probably available at CRAN by downloading the package source here: http://cran.r-project.org/web/packages/glmnet/index.html Look in the /src/ directory. Michael On Wed, Oct 26, 2011 at 9:42 PM, Axel Urbiz axel.ur...@gmail.com wrote: Hi, My apologies for asking this question, but could

[R] question regarding intersect function

2011-10-25 Thread Samir Benzerfa
Hi I have probably a very simple question but I'm going crazy trying to find the solution. I have two data.frames with headers and I'm doing an intersection between them by names, such that the intersected data.frames are returned by: df1[intersect(names (df1), names(df2))] and the same

Re: [R] question regarding intersect function

2011-10-25 Thread David Winsemius
On Oct 25, 2011, at 6:07 AM, Samir Benzerfa wrote: Hi I have probably a very simple question but I'm going crazy trying to find the solution. I have two data.frames with headers and I'm doing an intersection between them by names, such that the intersected data.frames are returned

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Hello, is there any help please. Regards 2011/10/21 Adel ESSAFI adeless...@gmail.com Hello I am discovering R and I find it is really very powerful. However, I find some newbie difficulties. Here, I have a data frame with manu values that I want to calculate the frequency (the nomber of

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
try this table(sci[,2]=0,sci[,1]=L) Weidong Gu On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI adel.s...@imag.fr wrote: Hello, is there any help please. Regards 2011/10/21 Adel ESSAFI adeless...@gmail.com Hello I am discovering R and I find it is really very powerful. However, I find

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Hi, It is not what I want, but, thx anyway. Regards 2011/10/22 Weidong Gu anopheles...@gmail.com try this table(sci[,2]=0,sci[,1]=L) Weidong Gu On Sat, Oct 22, 2011 at 7:51 AM, Adel ESSAFI adel.s...@imag.fr wrote: Hello, is there any help please. Regards 2011/10/21 Adel

Re: [R] question about aggregate

2011-10-22 Thread R. Michael Weylandt
Perhaps I misunderstand your request, but isn't this just: sum( (sci[,,2]==0L) (sci[,1] ==L)) with the usual floating point caveats. Michael On Sat, Oct 22, 2011 at 8:19 AM, Adel ESSAFI adeless...@gmail.com wrote: Hi, It is not what I want, but, thx anyway. Regards 2011/10/22 Weidong Gu

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
Is this waht you want? sci[,5][sci[,2]==0 sci[,1]==L] Weidong On Sat, Oct 22, 2011 at 8:19 AM, Adel ESSAFI adeless...@gmail.com wrote: Hi, It is not what I want, but, thx anyway. Regards 2011/10/22 Weidong Gu anopheles...@gmail.com try this table(sci[,2]=0,sci[,1]=L) Weidong Gu

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
NO aggregate(si[,7],list(si[,2],si[,1]),mean) Group.1 Group.2 x 1 0.0 D 212.5015448 2 0.2 D 200.5271137 3 0.4 D 191.5387529 4 0.6 D 131.5856218 5 0.8 D 16.4515798 6 1.0 D 0.9698699 7 0.0 F 211.6176036 8

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
2011/10/22 Adel ESSAFI adel.s...@imag.fr NO aggregate(si[,7],list(si[,2],si[,1]),mean) Group.1 Group.2 x 1 0.0 D 212.5015448 2 0.2 D 200.5271137 3 0.4 D 191.5387529 4 0.6 D 131.5856218 5 0.8 D 16.4515798 6 1.0

Re: [R] question about aggregate

2011-10-22 Thread Weidong Gu
Thanks for providing the example data, try this aggregate(si[,7],list(si[,2],si[,1]),function(x) sum(table(x))) Weidong On Sat, Oct 22, 2011 at 9:28 AM, Adel ESSAFI adel.s...@imag.fr wrote: NO aggregate(si[,7],list(si[,2],si[,1]),mean)    Group.1 Group.2   x 1  0.0   D

Re: [R] question about aggregate

2011-10-22 Thread Adel ESSAFI
Thank you I works as I need. aggregate(tmp[,5],list(tmp[,2],tmp[,1]),function(x) sum(table(x))) Group.1 Group.2 x 1 0.0 D 100 2 0.2 D 100 3 0.4 D 100 4 0.6 D 72 5 0.8 D 9 2011/10/22 Weidong Gu anopheles...@gmail.com Thanks for

[R] question about aggregate

2011-10-21 Thread Adel ESSAFI
Hi list I am discovering R, and -- PhD candidate in Computer Science Address 3 avenue lamine, cité ezzahra, Sousse 4000 Tunisia tel: +216 97 246 706 (+33640302046 jusqu'au 15/6) fax: +216 71 391 166 [[alternative HTML version deleted]] __

[R] question about aggregate

2011-10-21 Thread Adel ESSAFI
Hello I am discovering R and I find it is really very powerful. However, I find some newbie difficulties. Here, I have a data frame with manu values that I want to calculate the frequency (the nomber of line) of the some criteria. For exemple here, I want it to print the number of occurence

[R] question: ragged array

2011-10-16 Thread Helene Schreyer
Hello, I have a big problem which I’m just not able to solve. I created the following mean value from the following dataset structure: Id |value 1 | 2 1 | 3 1 | 4 2 | 2 2 | 1 3 | 5 4 | 3 etc.|etc. with the command: mean_rating - tapply(ratok$value, ratok$project_id ,

<    4   5   6   7   8   9   10   11   12   13   >