[R] [R-pkgs] hydroPSO 0.3-0 on CRAN

2013-01-11 Thread Mauricio Zambrano-Bigiarini
Dear R and hydrological/environmental community, A major release of hydroPSO is now available on CRAN. This new release: -) implements the Standard Particle Swarm 2011 (SPSO-2011) -) is parallel-capable, to alleviate the computational burden of complex models with "long" execution time -) has an

Re: [R] random effects model

2013-01-11 Thread rex2013
Hi AK Regarding the missing values, I would like to find out the patterns of missing values in my data set. I know the overall values for each variable. using colSums(is.na(df)) but what I wanted is to find out the percentages with each level of the variable with my datas

[R] [R-pkgs] Version 1.0 of royston package on CRAN‏

2013-01-11 Thread Selcuk KORKMAZ
Dear colleagues, This is to inform you that Version 1.0 of the R package royston has been released on CRAN. This package has a function to generate the Shapiro-Wilk's W statistic needed to feed the Royston's test for multivariate normality. It was taken from the Fortran Algorithm AS R94 (Roysto

[R] Extract data

2013-01-11 Thread shairul samat
Dear R users, I just join this forum a few minutes ago. My friend recommend this forum to me.   I have data in excel csv. My problem is I would like to extract some number, for example as highlighted below;   Year Ending   Maximum Value (Rain mm)  Gap from 19710509 09 to 19710607 08000

[R] A problem with X11 "headers/libs".

2013-01-11 Thread Rolf Turner
I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure the procedure comes to a halt with the error message: configure: error: --with-x=yes (default) and X11 headers/libs are not available But X11 is installed, and

[R] Merging list of dataframes with reshape merge_all

2013-01-11 Thread Johannes Radinger
Hi, I'd like to merge mutliple dataframes from a list of dataframes by some common columns. The approach for simply merging 2 dataframes is working with: merge(df1,df2,by=c("col1","col2","col3"),all=TRUE) For mutliple dataframes in a list I try to use the merge_all command from the package resha

Re: [R] Problem with inconsolata font (again) --- on Fedora 17 this time.

2013-01-11 Thread Milan Bouchet-Valat
Le vendredi 11 janvier 2013 à 14:50 +1300, Rolf Turner a écrit : > Some while ago I posted a problem on this list concerning a failure of > R CMD check on one of my packages that resulted from LaTeX being > unable to find the "inconsolata" font. This was under the Ubuntu OS. > > This was solved,

Re: [R] Sweave, Texshop, and sync with included Rnw file

2013-01-11 Thread Duncan Murdoch
On 13-01-10 4:54 PM, michele caseposta wrote: Hi everybody, thanks for the replies. I might have not explained the problem completely. Duncan Mackay: Yes, I am already having a master file and separate Rnw files. Duncan Murdock: I am using patchDVI in the TexShop Sweave engine. Sync works flawles

Re: [R] Extract data

2013-01-11 Thread PIKAL Petr
Hi No HTML. No highlighting. if you want some data from object use extraction operator ?"[" Petr > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of shairul samat > Sent: Friday, January 11, 2013 10:19 AM > To: r-help@r-proje

[R] count combined occurrences of categories

2013-01-11 Thread Biau David
Dear all,   i would like to count the number of times where I have combined occurrences of the categories of 2 variables.   For instance, in the dataframe below, i would like to know how many times each author (au1, au2, au3 represent the first, second, third author) is associated with each of t

Re: [R] count combined occurrences of categories

2013-01-11 Thread PIKAL Petr
Hi structure of your data frame is not suitable for this task. library(reshape) tutu.m<-melt(tutu, "nam") table(tutu.m$nam, tutu.m$value) art deb joy mar seb lio nem tat da 2 3 1 4 1 1 0 0 fr 2 2 2 3 0 1 1 1 ya 1 2 1 0 0 1 1 0 Rega

Re: [R] count combined occurrences of categories

2013-01-11 Thread Pascal Oettli
Hello, Maybe you can try something like that: count.au1 <- tapply(tutu$au1, tutu$nam, table) count.au2 <- tapply(tutu$au2, tutu$nam, table) count.au3 <- tapply(tutu$au3, tutu$nam, table) HTH, Pascal Le 11/01/2013 19:54, Biau David a écrit : Dear all, i would like to count the number of times

[R] Using table to get frequencies of several factors at once

2013-01-11 Thread Pancho Mulongeni
Hi, I have a dataframe with n columns, but I am only looking at five of them. And lots of rows, over 700. So I would like to find frequencies for each of the numeric columns (variables) using the table function. However, is there a fast way to produce a frequency table where the 5 rows represen

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Milan Bouchet-Valat
Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : > I am trying to build R-patched from source on a (newly installed) > Fedora 17 system on a new laptop. > > When I do the usual ./configure the procedure comes to a halt > with the error message: > > > configure: error: --with-x=yes

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Prof Brian Ripley
On 11/01/2013 11:28, Milan Bouchet-Valat wrote: Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure the procedure comes to a halt with the error messa

Re: [R] Problem with inconsolata font (again) --- on Fedora 17 this time.

2013-01-11 Thread Prof Brian Ripley
On 11/01/2013 01:50, Rolf Turner wrote: Some while ago I posted a problem on this list concerning a failure of R CMD check on one of my packages that resulted from LaTeX being unable to find the "inconsolata" font. This was under the Ubuntu OS. This was solved, thanks to advice I got from this

Re: [R] Merging list of dataframes with reshape merge_all

2013-01-11 Thread Rui Barradas
Hello, To "solve" the problem you can use all.x and all.y but I think there are other problems with merge_all, in the example below it doesn't include df2$Y in the result df. df1 <- data.frame(col1=1:10, col2=11:20, col3=21:30, X = rnorm(10)) df2 <- data.frame(col1=1:10, col2=11:20, col3=21:

Re: [R] Merging list of dataframes with reshape merge_all

2013-01-11 Thread Johannes Radinger
Hi Rui, thank you so far for your answer... ...as i found these other problems also myself, I decided to go for a looping apporach with the base merge command and always add a new dataframe to the old one (growing dataframe). /johannes On Fri, Jan 11, 2013 at 1:26 PM, Rui Barradas wrote: > Hell

[R] split & rbind (cast) dataframe

2013-01-11 Thread Johannes Radinger
Hi, I would like to split dataframe based on one colum and want to connect the two dataframes by rows (like rbind). Here a small example: # The orgininal dataframe df1 <- data.frame(col1 = c("A","A","B","B"),col2 = c(1:4), col3 = c(1:4)) # The datafame how it could look like df2 <- data.frame(A.

Re: [R] Using table to get frequencies of several factors at once

2013-01-11 Thread John Kane
Does something like this do what you want? It returns a list of tables md <- data.frame((matrix(sample(1:5, 100, replace = TRUE),nrow= 10))) str(md) apply(md, 2, table) John Kane Kingston ON Canada > -Original Message- > From: p.mulong...@namibia.pharmaccess.org > Sent: Fri, 11 J

Re: [R] Extract data

2013-01-11 Thread John Kane
Hi, welcome to the R-help list This help list does not accept html coded messages and so nothing meaningful seems to have come through. If you aready have the data loaded into R please supply some sample data The easiest way to supply data is to use the dput() function. Example with your

Re: [R] Merging list of dataframes with reshape merge_all

2013-01-11 Thread Hadley Wickham
> PS: Just a related side-question: Why is merge_all not included in the > "newer" package reshape2 as this is considered to be a reboot of the > reshape package? Because it doesn't work very well, as you've discovered. There's an equivalent join_all in plyr. Hadley -- Chief Scientist, RStudio

Re: [R] Problem with inconsolata font (again) --- on Fedora 17 this time.

2013-01-11 Thread José Matos
On 2013-01-11 01:50, Rolf Turner wrote: > > Some while ago I posted a problem on this list concerning a failure of > R CMD check on one of my packages that resulted from LaTeX being > unable to find the "inconsolata" font. This was under the Ubuntu OS. > > This was solved, thanks to advice I got f

[R] R's configure on Fedora 17

2013-01-11 Thread Martin Maechler
> Prof Brian Ripley > on Fri, 11 Jan 2013 11:49:26 + writes: > On 11/01/2013 01:50, Rolf Turner wrote: >> >> Some while ago I posted a problem on this list concerning a failure of >> R CMD check on one of my packages that resulted from LaTeX being >> unable to

[R] aggregate data.frame based on column class

2013-01-11 Thread Martin Batholdy
Hi, When using the aggregate function to aggregate a data.frame by one or more grouping variables I often have the problem, that I want the mean for some numeric variables but the unique value for factor variables. So for example in this data-frame: data <- data.frame(x = rnorm(10,1,2), group

Re: [R] split & rbind (cast) dataframe

2013-01-11 Thread Ista Zahn
Hi Johannes, Your example is tricky because the original df1 does not contain id columns that identify each cell in df2. If you want to use the reshape2 package for this I think you have to add a second id variable: df1 <- data.frame(col1 = c("A","A","B","B"),col2 = c(1:4), col3 = c(1:4)) librar

Re: [R] aggregate data.frame based on column class

2013-01-11 Thread Ista Zahn
Please see in line. On Fri, Jan 11, 2013 at 10:07 AM, Martin Batholdy wrote: > Hi, > > When using the aggregate function to aggregate a data.frame by one or more > grouping variables I often have the problem, that I want the mean for some > numeric variables but the unique value for factor vari

Re: [R] count combined occurrences of categories

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 2:54 AM, Biau David wrote: Dear all, i would like to count the number of times where I have combined occurrences of the categories of 2 variables. For instance, in the dataframe below, i would like to know how many times each author (au1, au2, au3 represent the first,

Re: [R] split & rbind (cast) dataframe

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 6:46 AM, Johannes Radinger < johannesradin...@gmail.com> wrote: > I would like to split dataframe based on one colum and want > to connect the two dataframes by rows (like rbind). Here a small example: > > # The orgininal dataframe > df1 <- data.frame(col1 = c("A","A","B","

[R] Help with Help on Windows

2013-01-11 Thread Ross Boylan
R 2.15.2 installed as a regular user on Windows 7. Three issues: 1. There is a start menu item for "R 2.15.2 Help" that opens a local web page. If I click on packages, then base, then abbreviate I get "Firefox can't find the file at /C:/Users/rdboylan/Documents/R/R-2.15.2/library/base/html/ab

Re: [R] count combined occurrences of categories

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 9:47 AM, arun wrote: HI David, I get different results with dcast() library(reshape2) dcast(melt(tutu,"nam"),nam~value,length) # nam art deb joy mar seb lio nem tat #1 da 2 3 1 4 1 1 0 0 #2 fr 2 2 2 3 0 1 1 1 #3 ya 1 2 1 0 0

[R] locating element in distance matrix

2013-01-11 Thread eliza botto
Dear useRs, I have a very basic question. I have a distance matrix and i skipped the upper part of it deliberately. The distance matrix is 1000*1000. Then i used "min" command to extract the lowest value from that matrix. Now i want to know what is the location of that lowest element? More pre

Re: [R] locating element in distance matrix

2013-01-11 Thread Berend Hasselman
On 11-01-2013, at 18:55, eliza botto wrote: > > Dear useRs, > I have a very basic question. I have a distance matrix and i skipped the > upper part of it deliberately. The distance matrix is 1000*1000. Then i used > "min" command to extract the lowest value from that matrix. Now i want to >

Re: [R] locating element in distance matrix

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 11:55 AM, eliza botto wrote: > > Dear useRs, > I have a very basic question. I have a distance matrix and i skipped the > upper part of it deliberately. The distance matrix is 1000*1000. Then i > used "min" command to extract the lowest value from that matrix. Now i want >

Re: [R] Help with Help on Windows

2013-01-11 Thread Duncan Murdoch
On 11/01/2013 12:49 PM, Ross Boylan wrote: R 2.15.2 installed as a regular user on Windows 7. Three issues: 1. There is a start menu item for "R 2.15.2 Help" that opens a local web page. If I click on packages, then base, then abbreviate I get "Firefox can't find the file at /C:/Users/rdboylan

Re: [R] locating element in distance matrix

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 9:55 AM, eliza botto wrote: Dear useRs, I have a very basic question. I have a distance matrix and i skipped the upper part of it deliberately. I have no idea what htat means. Code is always helpful in resolving ambiguities. The distance matrix is 1000*1000. Then i

[R] Access comonents in lists of lists

2013-01-11 Thread Bjoern Helm
Dear R users,I have a list of equally structured lists, how can I access e.g. all 2nd compontents in those sub-lists?An example:lst <- list(rep(list(1:3),3), rep(list(4:6),3))> lst[[1]][[1]][[1]][1] 1 2 3[[1]][[2]][1] 1 2 3[[1]][[3]][1] 1 2 3[[2]][[2]][[1]][1] 4 5 6[[2]][[2]][1] 4 5 6[[2]][[3]][1]

[R] problems with package 'segmented'

2013-01-11 Thread Benedikt Drosse
Dear R-users, I am trying to understand how the 'segmented'-package works to determine breakpoints and slopes of regression lines in broken-line regression models. However, I am not able to repeat the example on the "plant"-dataset, which was reported in the accompanying paper of the package. (V

[R] Weighted Kappa for m Raters

2013-01-11 Thread Marwa Gadala
Hello, I have 50 raters and 180 cases which are rated as malignant, probably malignant, probably benign, and benign. I want to compare all the raters but I want a weighted kappa to penalize differences between malignant and benign more than differences between malignant and probably malign

Re: [R] count combined occurrences of categories

2013-01-11 Thread arun
HI, You could try this: library(reshape2)  dcast(melt(tutu,"nam"),nam~value,length) #  nam art deb joy mar seb lio nem tat #1  da   2   3   1   4   1   1   0   0 #2  fr   2   2   2   3   0   1   1   1 #3  ya   1   2   1   0   0   1   1   0 A.K. - Original Message - From: Biau David To

[R] Using square brackets in a ploted expression

2013-01-11 Thread Monteiro, Jose
Dear Users, I have the following text plotted inside a graphic: text(16200, 2.8*0.97, expression(NH[3]==0.33-1.1 %*% 10^-5 %*% day), adj=c(1,1)) I need to include square brackets in the expression around the ammonia to have it plotted like that: [NO3-]. I tried instinctively to use %[% to plo

Re: [R] Learning to speak R: simple data processing

2013-01-11 Thread ej
Ah! Very nice. Thank you, Arun! -- View this message in context: http://r.789695.n4.nabble.com/Learning-to-speak-R-simple-data-processing-tp4655194p4655237.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] aggregate data.frame based on column class

2013-01-11 Thread arun
Hi, Hope this is what you meant. #data1 aggregate(.~group+gender,data=data1,mean) #  group gender x #1 2  f  1.750686 #2 1  m -1.074343 A.K. - Original Message - From: Martin Batholdy To: "r-help@r-project.org" Cc: Sent: Friday, January 11, 2013 10:07 AM Subje

Re: [R] count combined occurrences of categories

2013-01-11 Thread arun
HI David, I get different results with dcast() library(reshape2)   dcast(melt(tutu,"nam"),nam~value,length) #  nam art deb joy mar seb lio nem tat #1  da   2   3   1   4   1   1   0   0 #2  fr   2   2   2   3   0   1   1   1 #3  ya   1   2   1   0   0   1   1   0  tutus <- data.frame(nam=tutu$na

Re: [R] aggregate data.frame based on column class

2013-01-11 Thread arun
Hi, May be I misunderstood ur question. You could do this: res<-aggregate(.~group,data=data1,mean) res$gender<-data1$gender[match(res$gender,as.numeric(data1$gender))]  res #  group x gender #1 1 -1.074343  m #2 2  1.750686  f A.K. - Original Message - From: Mar

Re: [R] split & rbind (cast) dataframe

2013-01-11 Thread arun
HI, May be this also works for you:  do.call(cbind,by(df1[,-1],df1[,1],function(x) x))  # A.col2 A.col3 B.col2 B.col3 #1  1  1  3  3 #2  2  2  4  4 A.K. - Original Message - From: Johannes Radinger To: r-help@r-project.org Cc: Sent: Friday, January 11,

Re: [R] random effects model

2013-01-11 Thread arun
Hi, To get the missing values, you could use: set.seed(15) dat1<-data.frame(Gender=rep(c("M","F"),each=10), V1=sample(c(1:20,NA),20,replace=TRUE), V2=sample(c(20:30,NA),20,replace=TRUE)) library(reshape2)  dcast(melt(dat1,id="Gender"),Gender~variable,function(x) sum(is.na(x))) #  Gender V1 V2 #1 

[R] looking for R packages that can do the following:

2013-01-11 Thread Gilliland, Bill
1. Minimum Mean Square Estimation (for Multi-Dimensional Linear Regression) 2. Two-Sample Kolmogorov-Smirnov Tests 3. Empirical ANOVA Methods All this to be done on empirical data. I am new to the R world, any help would be appreciated. Thank You, Bill Gilliland Lead Senso

Re: [R] Queen City Cypher

2013-01-11 Thread Big Dipper Entertainment TV
Big Dipper TV Presents Gimmie da Mic "Queen City Cypher" For Registration & More info visit www.bigdippertv.com Big Dipper Entertainment TV sent this email to r-help@R-project.org Questions? Contact bigdippe...@gmail.com or Big Dipper Entertainment TV, c/o

Re: [R] another R2HTML question, please

2013-01-11 Thread Greg Snow
You might be better off using the knitr package which has options for whether to evaluate code or not (or which pieces of code to evaluate). If you use this in Rstudio then you can knit directly to html from a variety of input formats. Otherwise you can use the external program pandoc to convert

Re: [R] Help with Help on Windows

2013-01-11 Thread Ross Boylan
Thanks to Duncan for all his help. I have one tip to pass on. On 1/11/2013 10:34 AM, Duncan Murdoch wrote: On 11/01/2013 12:49 PM, Ross Boylan wrote: R 2.15.2 installed as a regular user on Windows 7. Three issues: 1. There is a start menu item for "R 2.15.2 Help" that opens a local web page.

Re: [R] Learning to speak R: simple data processing

2013-01-11 Thread Greg Snow
The apply function takes another function as the argument to be applied to each row (or column) of the matrix. You can use an existing function like you did with 'max' and in this case there is an existing function called 'which.max' that does exactly what you want. If there is not an existing fu

Re: [R] looking for R packages that can do the following:

2013-01-11 Thread Bert Gunter
Read "An Introduction to R" before posting further, please. You need to make at least some minimal effort to learn R first. -- Bert On Fri, Jan 11, 2013 at 10:20 AM, Gilliland, Bill wrote: > 1. Minimum Mean Square Estimation (for Multi-Dimensional Linear > Regression) > > 2. Two-Sam

Re: [R] looking for R packages that can do the following:

2013-01-11 Thread Bert Gunter
... and, I should have added, to learn how to search within R. ?help ?help.search ?help.start ?RSiteSearch There are also numerous other search engines that can be useful, such as RSeek.or. But google generally works well, too. -- Bert On Fri, Jan 11, 2013 at 10:20 AM, Gilliland, Bill wrote: >

Re: [R] Access comonents in lists of lists

2013-01-11 Thread Ista Zahn
lapply(lst, function(x) return(x[[2]])) On Fri, Jan 11, 2013 at 6:40 AM, Bjoern Helm wrote: > Dear R users,I have a list of equally structured lists, how can I access e.g. > all 2nd compontents in those sub-lists?An example:lst <- > list(rep(list(1:3),3), rep(list(4:6),3))> lst[[1]][[1]][[1]][1]

[R] overlaying zoo plots in lattice

2013-01-11 Thread A Duranel
Hello Let's say I have a multivariate zoo timeseries (synchronised automatic loggers at different places): library(zoo) library(lattice) library(latticeExtra) x<-zoo(data.frame(a=rnorm(100), c=rnorm(100), b=rnorm(100)), seq(from=as.Date("2010-01-01"), by="day", length.out=100)) and a dataframe

Re: [R] looking for R packages that can do the following:

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 10:20 AM, Gilliland, Bill wrote: > 1. Minimum Mean Square Estimation (for Multi-Dimensional Linear > Regression) ?lm > > 2. Two-Sample Kolmogorov-Smirnov Tests ?ks.test > > 3. Empirical ANOVA Methods ?lm > > All this to be done on empirical data. As

Re: [R] overlaying zoo plots in lattice

2013-01-11 Thread ilai
str(x) ; str(y) reveals #‘zoo’ series ... # ..$ : chr [1:3] "a" "c" "b" ## HERE # Index: Date[1:100], format: "2010-01-01" "2010-01-02" "2010-01-03" "2010-01-04" ... #'data.frame':99 obs. of 3 variables: # $ ID : Factor w/ 3 levels "a","b","c": ## HERE # ..

Re: [R] weird merge()

2013-01-11 Thread J Toll
On Fri, Jan 11, 2013 at 12:50 PM, array chip wrote: > Hi, > > I have some protein array data, each array in a separate text file. So I > read them in and try to combine them into a single data frame by using > merge(). see code below (If you download the attached data files into a > specific fold

Re: [R] weird merge()

2013-01-11 Thread array chip
Hi James, I am trying to combine 11 data frames by column, not by row. My original message has 11 data text files attached, did they go through so you can try my codes? Thanks John From: J Toll Cc: "r-help@r-project.org" Sent: Friday, January 11, 2013

Re: [R] weird merge()

2013-01-11 Thread array chip
Hi Dennis, Actually, I am trying to combine them by COLUMN, so that's why I am using merge(). The first loop was to simply read these protein data into R as 11 data frames, each data frame is 165 x 2. Then I use merge() to combine these data frames into 1 big data frame by column with these in

Re: [R] weird merge()

2013-01-11 Thread array chip
I just figured out the reason was the column (the 1st column in each data frame "gene.name") by which to merge each data frame has no unique values, some values were repeated, so when merging, the data frame gets bigger and bigger exponentially. Sorry to bother all. John ___

Re: [R] locating element in distance matrix

2013-01-11 Thread David L Carlson
If you have a dist object (created by dist()) or if you used lower.tri(x) to extract the lower triangle of the matrix, which() will not work since the matrix is now stored as a numeric vector with n(n-1)/2 elements where n is the number of rows/columns. In that case you must compute the original ro

Re: [R] locating element in distance matrix

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 1:51 PM, David L Carlson wrote: > If you have a dist object (created by dist()) or if you used lower.tri(x) to > extract the lower triangle of the matrix, which() will not work since the > matrix is now stored as a numeric vector with n(n-1)/2 elements where n is > the number

Re: [R] locating element in distance matrix

2013-01-11 Thread David L Carlson
If you really have a matrix to begin with, yes. But if you generated it from dist() or its relations, you would have to convert it to a matrix (roughly doubling the memory needed). The various hierarchical cluster functions usually want a dist object. > dm <- dist(x, diag=TRUE, upper=TRUE) > str(d

[R] ask for Dimension reduction, Manifold Learning R-package

2013-01-11 Thread Jieyue Li
Dear All, Does anyone know whether there is a R package existed for dimension reduction (manifold learning) methods, especially like Laplacian Eigenmaps? Thanks a lot! Best, Jieyue [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Determining sample size from power function

2013-01-11 Thread Kaveh Zakeri
Thank you for your response. However, I don't think the examples on that page relate to my problem. The power function I am using is different than the ones in the pwr package because I am working on the power for survival data with competing risks. I tried to emulate the examples in the link yo

Re: [R] locating element in distance matrix

2013-01-11 Thread eliza botto
Dear all,thanyou so very much. elisa > From: dcarl...@tamu.edu > To: dwinsem...@comcast.net > CC: eliza_bo...@hotmail.com; r-help@r-project.org > Subject: RE: [R] locating element in distance matrix > Date: Fri, 11 Jan 2013 16:41:13 -0600 > > If you really have a matrix to begin with, yes. But i

[R] Mean according to the combination of two factors

2013-01-11 Thread li li
Dear all, I have a data frame where there are three variables: values, experiment, composite. Values are numerical values. There are 10 levels for the experiment. Within each level of experiment, there are 17 levels of composite. I want to find mean for each combination of levels of the experi

Re: [R] Access comonents in lists of lists

2013-01-11 Thread Rolf Turner
On 01/12/2013 12:40 AM, Bjoern Helm wrote: Dear R users,I have a list of equally structured lists, how can I access e.g. all 2nd compontents in those sub-lists?An example:lst <- list(rep(list(1:3),3), rep(list(4:6),3))> lst[[1]][[1]][[1]][1] 1 2 3[[1]][[2]][1] 1 2 3[[1]][[3]][1] 1 2 3[[2]][[2]][[

Re: [R] Mean according to the combination of two factors

2013-01-11 Thread Rui Barradas
Hello, Try the following. # make up some data dat <- data.frame(values = rnorm(100), experiment = sample(10, 100, TRUE), composite = sample(17, 100, TRUE)) aggregate(values ~ experiment + composite, data = dat, FUN = mean) Hope this helps, Rui Barradas Em 11-01-2013 23:26, li li escreveu:

Re: [R] Access comonents in lists of lists

2013-01-11 Thread Bjoern Helm
Hi, thank you. I just came up with lapply(c(1:length(lst)), function(x) return(lst[[x]][[2]])) but your solution is much more elegant. Although I don't completely understand: if lst is the argument of function x[[2]] this should be iterpreted as lst[[2]]. Where am I wrong? Björn Am 11.01.20

[R] GPIB-compatible instrument control with R

2013-01-11 Thread Marko Tadjer
Hello, Does an R package exist for communication with instruments using GPIB (IEEE 488) protocol? Something similar exists in python for control of instruments over GPIB, RS232, or USB buses (http://pyvisa.sourceforge.net/) Thanks, Marko __ R-help@r-p

[R] add categorical labels in plot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a plot using the code below. Further, I want to add labels (White, Yellow, Red) to x-axis. Please kindly advise how to add the categorical labels, by modifying the code. Thank you. Elaine Code dataN <-read.csv("H:/skin_color.csv",header=T, row.names=1) dim(dataN)

[R] two-group comparison in boxplot

2013-01-11 Thread Elaine Kuo
Hello I have a data composing three columns: body weight, body length, and sex. I want to draw a box plot, X-axis for body weight, Y-axis for body length. In the boxplot, I want to compare the body length between two sexes of three groups of body weight: <50, 51-100, >101 kg. (For instance

Re: [R] random effects model

2013-01-11 Thread rex2013
Can you please explain the syntax? What I am trying to achieve is something of the sort( below is just an example): eg: Males hv 32% missing data as compared to 48% missing data amongst females. 60% missing data from primary educated compared to 5% in those completed uni.etc. Thanks a lot On Sa

Re: [R] Access comonents in lists of lists

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 3:26 PM, Bjoern Helm wrote: > Hi, > thank you. I just came up with > > lapply(c(1:length(lst)), function(x) return(lst[[x]][[2]])) > > > but your solution is much more elegant. Although I don't completely > understand: if lst is the argument of function x[[2]] this should

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Rolf Turner
On 01/12/2013 12:41 AM, Prof Brian Ripley wrote: On 11/01/2013 11:28, Milan Bouchet-Valat wrote: Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure

Re: [R] (SOLVED) Problem with inconsolata font (again) --- on Fedora 17 this time.

2013-01-11 Thread Rolf Turner
Thanks to everyone who responded to my cri de coeur. For the record, the solution to the problem was (in short) to do: sudo yum install texlive sudo yum install tex-inconsolata.noarch sudo yum install texlive-collection-fontsrecommended the last bit being the part that got me over one last hum

[R] how to change font size of axis label (not axis title)

2013-01-11 Thread Elaine Kuo
Hello, I am using lattice to produce xyplot. I want to change the font size of axis-X label. Please kindly advise how to write the code. Thank you. For changing the font size of axis-X title it would be xlab=list("Diet of Breeding Ground", cex = 1.4) Elaine [[alternative HTML versio

[R] panel failure in xyplot

2013-01-11 Thread Elaine Kuo
Hello I ran the code below but it said: no object "'panel.xyplot.intermediate.hh'" Please kindly advise how to modify the code. thank you. (It works with panel.bwplot.intermediate.hh) Elaine code library(HH) # data input dataN <-read.csv("H:/R_data/Mig_bird_586.csv",header=T, row.names

[R] Another X11 problem. (Psigh!)

2013-01-11 Thread Rolf Turner
Tried to do a plot just now and got an error: Error in text.default(2, 6, main, cex = cex) : X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 16 could not be loaded This is reproducible (in my current environment) via: par(mfrow=c(2,2)) plot(1:10) text(2,6,"Oh, hell!",c

[R] color in xyplot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a xyplot. Its dots will have three colors: red for meat, green for vegetable, and blue for both. I used the code below but could not make the dot in the same group show the same color. Please kindly advise how to modify it. Thank you. code library (lattice) diet.code <- c(

Re: [R] color in xyplot

2013-01-11 Thread David Winsemius
On Jan 11, 2013, at 8:38 PM, Elaine Kuo wrote: Hello I want to draw a xyplot. Its dots will have three colors: red for meat, green for vegetable, and blue for both. I used the code below but could not make the dot in the same group show the same color. Please kindly advise how to modify

Re: [R] random effects model

2013-01-11 Thread Usha Gurunathan
Hi I do want percentages of the categories inthe whole data set. But, I am a bit unclear about this syntax. Can you explain please. This is the error message I got with your script? Error: could not find function "Copy.of.BP_2". Not sure what, because the data frame was already loaded. Also