Re: [R] Frequency table

2010-04-16 Thread Robin Evans
> but I need to incorporate the speed values and have a table like the > following: >                 1     2     3     4     5     6 36 > 0-9 > 10-19 > 20-29 > 30-39 > 40-49 > 50+ > The final table will be used in the rosavent function to produce a wind rose > diagram just like in this exampl

Re: [R] bwplot puts the bars in the wrong place

2010-04-16 Thread Deepayan Sarkar
On Fri, Apr 16, 2010 at 1:54 PM, James Rome wrote: > Dear R-Help, > > With the attached data set, I am still getting incorrect bwplots None of your attachments came through (presumably because of the list filters), and we need the data to figure out what's happening. Either put the result of dput

Re: [R] read.table behavior for Dates.

2010-04-16 Thread David Scott
Jeroen Ooms wrote: Ah Phil Spector is right, nothing is converted. I'm almost too embarrassed to admit it, but actually, it was Excel that tricked me. It displays date fields differently than they are stored in the csv file, and once you press 'save', it saves everything to a different format, co

Re: [R] managing data and removing lines

2010-04-16 Thread Joshua Wiley
Hello Tara, To answer your question, I believe the simpler way you are looking for is specifying the na.string argument in read.table(). Using na.string specifies characters (or numbers) as missing data. For instance... I saved the first five lines of your data in a tab delimitted text file cal

[R] Frequency table

2010-04-16 Thread Kevin Turner
Hello, I'm trying to make a table like windfreq.dat in the rose diagram example of the climatol package. It looks like: N NNE NE ENEE ESE SE SSES SSW SW WSWW WNW NW NNW 0-3 59 48 75 90 71 15 10 11 14 20 22 22 24 15

Re: [R] efficient rolling rank

2010-04-16 Thread Charles C. Berry
On Fri, 16 Apr 2010, zerdna wrote: Could someone give me an idea on how to do rolling ranking, i.e. rank in the moving window of last 100 numbers in a long vector? I tried naive solution like roll.rank<-function(v, len){ r<-numeric(length(v)-len+1) for(i in len:length(v)) r[i-len+

Re: [R] managing data and removing lines

2010-04-16 Thread Christopher W. Ryan
Tara-- Welcome to R! Your questions could be answered from a variety of angles. I'd start by asking, where did the n/a's come from--they were in your text file, I assume, to represent missing data? If so, when you imported your data from that text file into R, those n/a's were considered (ri

Re: [R] bwplot puts the bars in the wrong place

2010-04-16 Thread James Rome
On 4/16/2010 8:27 PM, Jun Shen wrote:Jim, Try this, bwplot(tt~as.factor(OnHour),data=gdf,..) Jun Shen from Millipore I already tried using a factor, and the data set I enclosed had gdf$OnHFact which was already a factor. It gave the same wrong plot. What did work was to call xyplot instead

[R] Problems with labels and scaling in star diagrams

2010-04-16 Thread Euan Reavie
I have the following small dataset: > stardata NSHEEBCWRW PW 1 0 0.000 0.000 0.042 0.006 0 2 0 0.006 0.000 0.013 0.005 0 3 0 0.000 0.011 0.000 0.000 0 I have plotted the star diagrams as follows: stars(stardata, key.labels = dimnames(stardata)[[2]], labels

Re: [R] efficient rolling rank

2010-04-16 Thread Gabor Grothendieck
I don't know if its any faster but you could try: library(zoo) z <- zoo(v) rollapply(z, len, function(x) rank(x)[len]) On Fri, Apr 16, 2010 at 4:21 PM, zerdna wrote: > > Could someone give me an idea on how to do rolling ranking, i.e. rank in the > moving window of last 100 numbers in a long vec

[R] Check for overdispersion in logit model

2010-04-16 Thread Jay
A quick question for those that are familiar with the subject, is it OK to check for overdispersion in a logit model using: sum(resid(model, type = "pearson")^2) / df.residual(model) Are tehre other commands? packages? /Jay __ R-help@r-project.org mai

[R] managing data and removing lines

2010-04-16 Thread Tara Imlay
Hi, I am very new to R and I've been trying to work through the R book to gain a better idea of the code (which is also completely new to me). Initially I imputed my data from a text file and that seemed to work ok, but I'm trying to examine linear relationships between gdist and gair, gdist and

[R] efficient rolling rank

2010-04-16 Thread zerdna
Could someone give me an idea on how to do rolling ranking, i.e. rank in the moving window of last 100 numbers in a long vector? I tried naive solution like roll.rank<-function(v, len){ r<-numeric(length(v)-len+1) for(i in len:length(v)) r[i-len+1]<-rank(v[(i-len+1):i])[len] r

Re: [R] bwplot puts the bars in the wrong place

2010-04-16 Thread Jun Shen
Jim, Try this, bwplot(tt~as.factor(OnHour),data=gdf,..) Jun Shen from Millipore On Fri, Apr 16, 2010 at 3:54 PM, James Rome wrote: > Dear R-Help, > > With the attached data set, I am still getting incorrect bwplots > > > xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf) # Is correct > >

Re: [R] Scanning only specific columns into R from a VERY large file

2010-04-16 Thread Peter Ehlers
On 2010-04-16 16:21, Sharpie wrote: Josh B-3 wrote: Hi, I turn to you, the R Sages, once again for help. You've never let me down! (1) Please make the following toy files: x<- read.table(textConnection("var.1 var.2 var.3 var.1000 indv.1 1 5 9 7 indv.21 2 9 3 8"), header = TRUE) y<- re

Re: [R] Multiple comparisons on Anova.mlm object

2010-04-16 Thread John Fox
Dear Gabriel and Bert, Bert's points are well taken, but you can compute tests of linear hypotheses for a repeated-measures MANOVA using the linear.hypothesis function in the car package. I'm not sure how you'd correct these tests for simultaneous inference with anything other than a Bonferroni ad

Re: [R] how to change the position of xlab in truehist?

2010-04-16 Thread Peter Ehlers
On 2010-04-16 16:00, Hua Li wrote: Hi, I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds t

Re: [R] how to change the position of xlab in truehist?

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 6:00 PM, Hua Li wrote: Hi, I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin co

Re: [R] Scanning only specific columns into R from a VERY large file

2010-04-16 Thread Sharpie
Josh B-3 wrote: > > Hi, > > I turn to you, the R Sages, once again for help. You've never let me down! > > (1) Please make the following toy files: > > x <- read.table(textConnection("var.1 var.2 var.3 var.1000 > indv.1 1 5 9 7 > indv.21 2 9 3 8"), header = TRUE) > > y <- read.table(text

[R] Scanning only specific columns into R from a VERY large file

2010-04-16 Thread Josh B
Hi, I turn to you, the R Sages, once again for help. You've never let me down! (1) Please make the following toy files: x <- read.table(textConnection("var.1 var.2 var.3 var.1000 indv.1 1 5 9 7 indv.21 2 9 3 8"), header = TRUE) y <- read.table(textConnection("var.3 var.1000"), header = TRUE

[R] how to change the position of xlab in truehist?

2010-04-16 Thread Hua Li
Hi, I'm wondering how can I change the position of xlab in truehist. For example, the following code creats a histogram with 4 bins for my discrete data. I want each bin to be labelled as 0, 1, 2, or 3 in the middle, so that it's clear each bin corresponds to each of the discrete case. I was

Re: [R] return of a function

2010-04-16 Thread Gustave Lefou
Thank you David, Jim and Gunter. Actually I knew about the list thing. Everything got confused in my head :-( I guess I am a bit tired... 2010/4/16 David Winsemius > > On Apr 16, 2010, at 12:02 PM, Gustave Lefou wrote: > > Dear R users, >> >> I have a function which takes as arguments big array

Re: [R] curve

2010-04-16 Thread Dwayne Blind
Thanks to all three of you 2010/4/15 Greg Snow > Or here is a way to plot against one of the variables while interactively > changing the other one: > > library(TeachingDemos) > > myfun <- function(x,y) sin(x^2) * cos(y^2) > > myfun2 <- function(y) curve( myfun(x,y), from=-pi, to=pi, ylim=c(-1,1

[R] Command not found

2010-04-16 Thread Sébastien Bihorel
Dear R users, I am getting the following error anytime I try to open a vignette, e.g.: > vignette('frame',package='grid') sh: : command not found I am working with "R version 2.11.0 Under development (unstable) (2010-02-17 r51148)" installed on an OpenSuse 11.0 system. Thanks for your help Seb

Re: [R] GSL in C code for R

2010-04-16 Thread Prof Brian Ripley
On Fri, 16 Apr 2010, Charles C. Berry wrote: On Fri, 16 Apr 2010, J. Sebastian Tello wrote: Dear fellow R users, I am now investing time in learning how to use compiled C code to produces functions that can be used in R. I am just starting, and there is much that I need to learn, so I have

[R] bwplot puts the bars in the wrong place

2010-04-16 Thread James Rome
Dear R-Help, With the attached data set, I am still getting incorrect bwplots > xyplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf) # Is correct > bwplot(gdf$tt~gdf$OnHour |gdf$Runway, data=gdf, horizontal=FALSE) # Puts the boxes on the wrong x-axis values # look especially at 0 and 3. How do

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Jeroen Ooms
Ah Phil Spector is right, nothing is converted. I'm almost too embarrassed to admit it, but actually, it was Excel that tricked me. It displays date fields differently than they are stored in the csv file, and once you press 'save', it saves everything to a different format, completely unasked. N

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 3:39 PM, Atte Tenkanen wrote: Hi, In fact, my original intention is to show that the measurings of the musical data are not random. Here I have a measurement from a composition. http://www.ag.fimug.fi/~Atte/Comp.pdf and here one random composition which I have used,

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Phil Spector
Jeroen - read.table is not converting anything. You're confusing the output you see at yahoo with the contents of the csv file. two = readLines("http://ichart.finance.yahoo.com/table.csv?s=GOOG&a=07&b=19&c=2004&d=03&e=16&f=2010&g=d&ignore=.csv";) two[1:3] [1] "Date,Open,High,Low,Close,Volu

Re: [R] read.table behavior for Dates.

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 3:57 PM, Jeroen Ooms wrote: Yes I know I can manually do it, but I am using it for scripts in which users upload files. Hence, I don't know what's going to come; I don't know on before hand whether data will contain Dates, and in which columns they appear. This is why

Re: [R] GSL in C code for R

2010-04-16 Thread Tobias Verbeke
Hi Sebastian, J. Sebastian Tello wrote: > Dear fellow R users, > > I am now investing time in learning how to use compiled C code to produces functions that can be used in R. I am just starting, and there is much that I need to learn, so I have a question that might be straight forward. I am l

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Greg Snow
Part of the issue is that the creators of R and the read.table function make the unusual, but hopefully correct, assumption that you know more about your data than they do. This gives you flexibility, power, and yes, responsibility. What should read.table do if it sees an entry like: "04-10-12"

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Henrique Dallazuanna
Try this: patt <- "\\d{4}[-/]\\d{2}[-/]\\d{2}" # could be \\d{2}[-/]\\d{2}[-/]\\d{4}, etc... idx <- colSums(sapply(myData, regexpr, pattern = patt)) > 0 myData[idx] <- lapply(myData[idx], as.Date) On Fri, Apr 16, 2010 at 4:57 PM, Jeroen Ooms wrote: > > Yes I know I can manually do it, but I am

Re: [R] Multiple comparisons on Anova.mlm object

2010-04-16 Thread Bert Gunter
Gabriel: The post hoc comparison tests that you reference are of doubtful validity or utility in anything but balanced designs with simple covariance structures. With missing data there are two critical issues: why are the data missing and how do they need to be handled as a result? -- just ignori

Re: [R] GSL in C code for R

2010-04-16 Thread Charles C. Berry
On Fri, 16 Apr 2010, J. Sebastian Tello wrote: Dear fellow R users, I am now investing time in learning how to use compiled C code to produces functions that can be used in R. I am just starting, and there is much that I need to learn, so I have a question that might be straight forward. I a

[R] RCurl slow when sending data over 1kb

2010-04-16 Thread Abiel X Reinhart
I am using RCurl's curlPerform command to send an XML string to an HTTP server running on the localhost. The command is something like this: reader <- basicTextGatherer() curlPerform(url="http://127.0.0.1/";, httpheader=c('Content-Type' = "text/xml; charset=utf-8"), postfields=t

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Atte Tenkanen
Hi, In fact, my original intention is to show that the measurings of the musical data are not random. Here I have a measurement from a composition. http://www.ag.fimug.fi/~Atte/Comp.pdf and here one random composition which I have used, among many others, in order to produce that 'Distributio

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Atte Tenkanen
Thanks, OK. My question is if there is any reasonable way to find p=0.05 boundaries for such a random distribution? Unfortunately I'm not statistician and thus I'm not sure, if even this question makes sense... Should we always consider samples of, say, more than 30 individuals? Atte Tenkanen

[R] Multiple comparisons on Anova.mlm object

2010-04-16 Thread Kaufman Gabriel
I would like to perform multiple comparisons or post-hoc testing on the independent variable in an Anova.mlm object generated by the Anova function of the car package. I have defined a multivariate linear model and subsequently performed a repeated measures ANOVA as per the instructions in secti

Re: [R] histogram breaks

2010-04-16 Thread Daniel Malter
?hist shows you the options - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of casperyc Sent: Friday, April 16, 2010 3:56 PM To: r-help@r-project.org Subject

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Jeroen Ooms
Yes I know I can manually do it, but I am using it for scripts in which users upload files. Hence, I don't know what's going to come; I don't know on before hand whether data will contain Dates, and in which columns they appear. This is why I was surprised that read.table has some (undocumented) b

[R] histogram breaks

2010-04-16 Thread casperyc
=== Q2=c( + sample(10:19,8,T), + sample(20:24,15,T), + sample(25:29,25,T), + sample(30:39,18,T), + sample(40:49,12,T), + sample(50:64,7,T), + sample(65:89,5,T) + ) hist(Q2) can give me a histogram, however, how do i get a different 'b

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Henrique Dallazuanna
Try this: myData <- read.csv("http://ichart.finance.yahoo.com/table.csv?s=GOOG&a=07&b=19&c=2004&d=03&e=16&f=2010&g=d&ignore=.csv";, colClasses = c('Date', rep('numeric', 6))) On Fri, Apr 16, 2010 at 4:32 PM, Jeroen Ooms wrote: > > When read.table imports a table that includes a header c

[R] GSL in C code for R

2010-04-16 Thread J. Sebastian Tello
Dear fellow R users, I am now investing time in learning how to use compiled C code to produces functions that can be used in R. I am just starting, and there is much that I need to learn, so I have a question that might be straight forward. I am learning how to use function in the C library GS

Re: [R] read.table behavior for Dates.

2010-04-16 Thread Kjetil Halvorsen
use the argument colClasses of read.table Kjetil On Fri, Apr 16, 2010 at 3:32 PM, Jeroen Ooms wrote: > > When read.table imports a table that includes a header called 'Date', it > tries to recognize the date format. For example, if one imports this data > from Yahoo finance, the Date column is

[R] more on bwplot problem

2010-04-16 Thread James Rome
Alas, no one answered my last post about my problem of doing bwplot. I think my problem is related to the fact that there is a value missing in my data: levels(as.factor(gdf$OnHour)) [1] "0" "1" "2" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Greg Snow
It would help if you could give more detail on what you are trying to accomplish. You can get boundaries from a dataset using the quantile function, but it is not clear if that is really what you want or not. Asking about a sample size of 30 implies that you want to do some normal based infere

[R] read.table behavior for Dates.

2010-04-16 Thread Jeroen Ooms
When read.table imports a table that includes a header called 'Date', it tries to recognize the date format. For example, if one imports this data from Yahoo finance, the Date column is automatically transformed to Y-m-d, whereis in the data it appears as m/d/Y: myData <- read.csv("http://ichart.

[R] [R-pkgs] formatR: farewell to ugly R code

2010-04-16 Thread Yihui Xie
This is an announcement of the release of an R package 'formatR', which can help us format our R code to make it more human-readable. If you have ugly (I mean unformatted) R code like this:  # rotation of the word "Animation" # in a loop; change the angle and color # step by step for (i in 1:360)

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Christos Argyropoulos
So .. are you trying to figure out whether your data hasa substantial number of outliers that call into question the adequacy of the normal distro fro your data? If this is the case, note that you cannot individually check the values (as you are doing) without taking into account of the "

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread Greg Snow
Several points: 1. The Shapiro test does not tell you that something is normal or highly normal, only that you don't have enough evidence to disprove that the data came from a normal population (powered for a certain type of deviation from normality). 2. The z.test function is intended to be u

Re: [R] problem with FUN in Hmisc::summarize

2010-04-16 Thread Frank E Harrell Jr
arnaud chozo wrote: Hi all, I'd like to use the Hmisc::summarize function, but it uses a function (FUN) of a single vector argument to create the statistical summaries. Consider an easy case: I'd like to compute the correlation between two variables in my dataframe, grouped according to other v

Re: [R] Is it ok to apply the z.test this way?

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 12:11 PM, Atte Tenkanen wrote: Dear R-users, I want to check if certain values are from random distribution, that includes values between 0-1. So, it is not really normal even though shapiro.test says it is highly normal... Can I do something like this and think that

Re: [R] R loop.

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 11:52 AM, Thomas Stewart wrote: I'm not sure I completely understand your question, but I think the solution to your problem is the reshape function in the reshape package. Except there is no reshape function in the reshape package. Your code works because the reshape

[R] Is it ok to apply the z.test this way?

2010-04-16 Thread Atte Tenkanen
Dear R-users, I want to check if certain values are from random distribution, that includes values between 0-1. So, it is not really normal even though shapiro.test says it is highly normal... Can I do something like this and think that the values given are right. z.test is from package Teachin

Re: [R] R loop.

2010-04-16 Thread Thomas Stewart
I'm not sure I completely understand your question, but I think the solution to your problem is the reshape function in the reshape package. Here is a silly example of how it would work: > V<-matrix(rbinom(15,4,.5),nrow=3) > X<-data.frame(A=c("A","B","C"),V=V) > X A V.1 V.2 V.3 V.4 V.5 1 A 1

Re: [R] Efficiency of C Compiler in "R CMD SHLIB"

2010-04-16 Thread yehengxin
I wonder how to further improve the optimization level of gcc. I thought "O-3" has already been the best. -- View this message in context: http://n4.nabble.com/Efficiency-of-C-Compiler-in-R-CMD-SHLIB-tp1934429p2008994.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Efficiency of C Compiler in "R CMD SHLIB"

2010-04-16 Thread yehengxin
Thank you very much for your kind explanation. I did find my DLL compiled using either VC++ 6.0 or Intel Compiler (almost equally fast) is significanlty faster than that compiled using gcc (55 seconds vs. 78 seconds), the default compiler in R. I did not choose "debug" mode when using gcc so I s

Re: [R] Image RGB calculation

2010-04-16 Thread ole_roessler
Thanks a lot, i will try this out! Ole -- View this message in context: http://n4.nabble.com/Image-RGB-calculation-tp1989864p2013203.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.

Re: [R] run R script from Excel VBA

2010-04-16 Thread Guy Green
See RExcel, http://rcom.univie.ac.at/ http://rcom.univie.ac.at/ and especially the video demo http://rcom.univie.ac.at/RExcelDemo/ http://rcom.univie.ac.at/RExcelDemo/ Guy -- View this message in context: http://n4.nabble.com/run-R-script-from-Excel-VBA-tp2009478p2011942.html Sent from the

[R] call R script from Excel VBA/macro

2010-04-16 Thread KZ
i wrote a R script say called computeCovarMatrix.R and i want to call and run this piece from Excel visual basic. does anyone know how to do that? thanks, KZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat

[R] How to get rid of extra areas on spatial data map

2010-04-16 Thread Changyou Sun
Hello All, I am using "sp" and "maps" libraries to have a map for some fire data. The region covered is Mississippi State in the US. Then I would like to add a layer of ecoregion on the top (omenrik layer from nationalatlas.gov). The problem is that the ecoregion layer is larger than the state bou

[R] read xml

2010-04-16 Thread Alex Campos
Hi I am trying to read selected fields from a xml file with R using xml package. So far I have learned the basics of this package by going through the manual, examples, tutorial, and so on (www.omegahat.org/RSXML) . The problem is that I am getting stuck when it comes down to more complex xm

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Kathie
thanks a lot. good day. Kathie On Fri, Apr 16, 2010 at 1:43 PM, Henrique Dallazuanna [via R] < ml-node+2013302-929204043-67...@n4.nabble.com > wrote: > Try this: > > sweep(a, 1, b, '/') > > On Fri, Apr 16, 2010 at 2:30 PM, Kathie <[hidden > email]

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Gavin Simpson
On Fri, 2010-04-16 at 09:30 -0800, Kathie wrote: > Dear R users, > > I am looking for more efficient way to compute the followings > > -- > > a <- matrix(c(1,1,1,1,2,2,2,2),4,2) > b <- matrix(c(1,2,3,4),4,1) Is there a reas

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Christian Raschke
Since b is only one column, just make it a vector. > a <- matrix(c(1,1,1,1,2,2,2,2),4,2) > b <- c(1,2,3,4) then > result <- a/b > result [,1] [,2] [1,] 1.000 2.000 [2,] 0.500 1.000 [3,] 0.333 0.667 [4,] 0.250 0.500 should be what you want. It is

Re: [R] PCA scores

2010-04-16 Thread Gavin Simpson
On Fri, 2010-04-16 at 10:23 -0700, phoebe kong wrote: > Hi all, > > I have a difficulty to calculate the PCA scores. The PCA scores I calculated > doesn't match with the scores generated by R, > > mypca<-princomp(mymatrix, cor=T) > > myscore<-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) > >

Re: [R] VERY SIMPLE QUESTION

2010-04-16 Thread Henrique Dallazuanna
Try this: sweep(a, 1, b, '/') On Fri, Apr 16, 2010 at 2:30 PM, Kathie wrote: > > Dear R users, > > I am looking for more efficient way to compute the followings > > -- > > a <- matrix(c(1,1,1,1,2,2,2,2),4,2) > b <- matrix(c(

[R] VERY SIMPLE QUESTION

2010-04-16 Thread Kathie
Dear R users, I am looking for more efficient way to compute the followings -- a <- matrix(c(1,1,1,1,2,2,2,2),4,2) b <- matrix(c(1,2,3,4),4,1) Eventually, I want to get this matrix, `c`. c <- matrix(c(1/1,1/2,1/3,1/4,2/1,

[R] PCA scores

2010-04-16 Thread phoebe kong
Hi all, I have a difficulty to calculate the PCA scores. The PCA scores I calculated doesn't match with the scores generated by R, mypca<-princomp(mymatrix, cor=T) myscore<-as.matrix(mymatrix)%*%as.matrix(mypca$loadings) Does anybody know how the mypca$scores were calculated? Is my formula not

Re: [R] TeachingDemos install bumps out with 'Out of memory!'

2010-04-16 Thread Greg Snow
I have no idea what is happening here (not an ubunto or linux expert), but it seems unlikely that the particular package is the main problem, rather that is the package you happen to be on when the problem manifests. TeachingDemos does not have any compiled code (all straight R code) and does n

Re: [R] Poblems wih EBImage

2010-04-16 Thread Gregoire Pau
Hello, EBImage is a Bioconductor package: please post on the Bioconductor mailing list. EBImage requires the libraries ImageMagick and GTK+ to be installed. Did you follow the instructions of the installation manual ? http://www.bioconductor.org/packages/release/bioc/html/EBImage.html It lo

Re: [R] Bootstrapping a repeated measures ANOVA

2010-04-16 Thread Fischer, Felix
Thank you for your answer. Sorry for the missing example. In fact, i think, i solved the issue by some data-manipulations in the function. I splitted the data (one set for each measuring time), selected the cases at random, and then combined the two measuring times again. Results look promisin

Re: [R] Weights in binomial glm

2010-04-16 Thread Thomas Lumley
Jan, Thierry is correct in saying that you are misusing glm(), but there is also a numerical problem. You are misusing glm() because your model specification claims to have Binomial(n,p) observations with w in the vicinity of 100, where there is a single common p but the observed binomial p

Re: [R] score counts in an aggregate function

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 11:16 AM, KDT wrote: Thanks Ista Works well You might also get further value from reviewing the various describe functions (there must be 5 or six packages with different versions). The Hmisc::descibe works very well for me and would have given you tabular counts f

Re: [R] Exporting an rgl graph

2010-04-16 Thread Greg Snow
The easiest approach may be to just install R onto a USB drive (flash/thumb/...) then when you go to your coworkers computer just run R from the USB drive and show the rgl plot. I think there is also a tool to create an animation from rgl, it is not interactive, but you could e-mail a movie fil

Re: [R] return of a function

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 12:02 PM, Gustave Lefou wrote: Dear R users, I have a function which takes as arguments big arrays, say : w, x , y and z. My function changes these arrays and I want them as result/output. I have tried to write return(w,x,y,z), and thus to replace the previous w, x,

Re: [R] return of a function

2010-04-16 Thread Bert Gunter
Below Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gustave Lefou Sent: Friday, April 16, 2010 9:03 AM To: r-help@r-project.org Subject: [R] return of a function Dear R users, I have

Re: [R] return of a function

2010-04-16 Thread jim holtman
You can return a single object from a function. If you want multiple values, use a list: f <- function(x,y,z){ return(list(x=x, y=y, z=z)) } value <- f(x,y,z) # now copy the values x <- value$x y <- value$y z <- value$z On Fri, Apr 16, 2010 at 12:02 PM, Gustave Lefou wrote: > Dear R use

[R] return of a function

2010-04-16 Thread Gustave Lefou
Dear R users, I have a function which takes as arguments big arrays, say : w, x , y and z. My function changes these arrays and I want them as result/output. I have tried to write return(w,x,y,z), and thus to replace the previous w, x, y and z. It does not seem to work. What can I do ? Thank y

Re: [R] Bootstrapping a repeated measures ANOVA

2010-04-16 Thread Charles C. Berry
On Fri, 16 Apr 2010, Fischer, Felix wrote: Hello everyone, i have a question regarding the sampling process in boot(). "PLEASE ... provide commented, minimal, self-contained, reproducible code." Which means something a correspondent could actually run. But before that, a careful reading of

Re: [R] data.frame and ddply

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 9:28 AM, arnaud Gaboury wrote: Dear group, Here is my df : futures <- structure(list(CONTRAT = c("WHEAT May/10 ", "WHEAT May/10 ", "WHEAT May/10 ", "WHEAT May/10 ", "COTTON NO.2 May/10 ", "COTTON NO. 2 May/10 ", "COTTON NO.2 May/10 ", "PLATINUM Jul/10 ", " SUGAR NO.11 M

Re: [R] xyplot ontop a contourplot (package: lattice)

2010-04-16 Thread Peter Ehlers
On 2010-04-16 7:43, Jay wrote: Hello, I have a contourplot plot that shows the data I want. However, I would like to point a certain amount of points from this plot via a xyplot(). Example: x<- seq(pi/4, 5 * pi, length.out = 100) y<- seq(pi/4, 5 * pi, length.out = 100) r<- as.vector(sqrt(outer

Re: [R] run R script from Excel VBA

2010-04-16 Thread Erich Neuwirth
Have a look at rcom.univie.ac.at. We have an Excel addin which will allow you to do that. Disclaimer: I am the author of the addin. On 4/16/2010 4:57 PM, KZ wrote: > I wrote a R script say called computeCovarMatrix.R and i want to call and > run this piece from Excel visual basic. does anyone kn

[R] piecewise nls?

2010-04-16 Thread Derek Ogle
I am looking into fitting a so-called double von Bertalanffy function to fish length-at-age data. Attempting to simplify the situation, the model looks like this ... Y ~ f(X; a,b,c) if x < Z Y ~ g(X; a,d,e) if x >= Z where * f and g are non-linear functions (the "traditional" "single" von Be

Re: [R] format() method

2010-04-16 Thread David Winsemius
On Apr 16, 2010, at 9:28 AM, kafkaz wrote: Hello, I use format() function to get number of the week, like this: format(tmp,'%U') Recently, I have spotted something bizarre. For example, I have such object: (index(tmp$x.delta['2009'][1:16])) [1] "2009-01-02 CET" "2009-01-09 CET" "2009-01-1

[R] Outlier detection from trayectory data

2010-04-16 Thread Usuario R
Hi all, I am trying to analyze data coming from trajectories of moving objects. It can be take as a two dimension time serie. The only method I've found is this: http://figment.cse.usf.edu/~sfefilat/data/papers/TuAT10.41.pdf Anyone know if this method is already implemented in R of if there is a

Re: [R] score counts in an aggregate function

2010-04-16 Thread KDT
Thanks Ista Works well Trevor -- View this message in context: http://n4.nabble.com/score-counts-in-an-aggregate-function-tp2007152p2011057.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

Re: [R] score counts in an aggregate function

2010-04-16 Thread Ista Zahn
Hi Trever, You can do it like this: count <- function(x) { length(na.omit(x)) } counts <- data.frame(aggregate(mydata[,4:5],by=list(mydata$userid),FUN="count")) -Ista On Fri, Apr 16, 2010 at 10:35 AM, KDT wrote: > > Dear R-Users, > I have a big data set "mydata" with repeated observation an

[R] grofit

2010-04-16 Thread nikita vasilov
Hello, I'm very impressed with the prospect of using grofit. It seems to be as impressive as the Markov msm unit that I've worked with. I would like to ask: can someone say something about how the starting values (as well as the values for each time point) are estimated? That is, is the curve built

[R] run R script from Excel VBA

2010-04-16 Thread KZ
I wrote a R script say called computeCovarMatrix.R and i want to call and run this piece from Excel visual basic. does anyone know how to do that? thanks, KZ [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat

Re: [R] how can I plot the histogram like this using R?

2010-04-16 Thread Gustaf Rydevik
On Fri, Apr 16, 2010 at 10:13 AM, bbslover wrote: > >  Thanks for your reply, I just want to get the figure like y1.jpg using the > data from y1.txt. >  Through the figure  I want to obtain the split point like y1.jpg, and > consider 2.5 as the plit point.  This figure is drawn by other people, I

[R] score counts in an aggregate function

2010-04-16 Thread Kadengye Trevor
Dear r-list, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2

Re: [R] problem with FUN in Hmisc::summarize

2010-04-16 Thread hadley wickham
> corr.V2.V3 = function(x) { >  out = cor(x$V2, x$V3) >  names(out) = "CORR" >  return(out) > } A litte more concisely: corr.V2.V3 = function(x) { c(CORR = cor(x$V2, x$V3)) } -- Assistant Professor / Dobelman Family Junior Chair Department of Statistics / Rice University http://had.co.nz/ __

Re: [R] format() method

2010-04-16 Thread Don MacQueen
Were you expecting "01", and is that why you are puzzled? See ?strftime and the explanation of the %U format. It depends on where the first Sunday of the year happens to fall. -Don At 5:28 AM -0800 4/16/10, kafkaz wrote: Hello, I use format() function to get number of the week, like this: fo

Re: [R] GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?

2010-04-16 Thread Simon Wood
Both versions of this should have worked, but you are right that the first version didn't when used with `gamm', I've fixed this for mgcv 1.6-2 (`mgcv:gam' was ok). Thanks for this. best, Simon On Wednesday 14 April 2010 09:03, JANSEN, Ivy wrote: > Hi, > > I was reading the book on "Mixed Effec

[R] score counts in an aggregate function

2010-04-16 Thread KDT
Dear R-Users, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 01 1 1 1 02 0 1 1 03 NA 1 1 04 1 0 2

Re: [R] vector matching

2010-04-16 Thread Henrique Dallazuanna
If I understand: unique(t(apply(rbind(x, y), 1, sort))) On Fri, Apr 16, 2010 at 11:05 AM, Michael Nestrud wrote: > Hello all, > > I have searched the archives for a similar problem to no avail.  I > could use  your help. > > I have a bunch of vectors organized into two matrices, x and y.  These

Re: [R] Weights in binomial glm

2010-04-16 Thread ONKELINX, Thierry
Jan, You misread the documentation of ?glm. Note that glm works with different kinds of families. So the first statement about weights is rather general: it holds for most of the families. It explicitly tells you that is not the case with the binomial family. From the documentation: "For a bino

[R] Yet Testing rKward

2010-04-16 Thread Ronaldo Reis Junior
Hi, I continue testing rKward. I dont know how to save the results from a script execution without use copy and paste or using a rkward output system. Now I try to understand how adapt my script do use the rKward output system. Example: I have this script: -- ## Carregar a

  1   2   >