[R] match and which give NA for some values, but not others

2011-07-27 Thread Heemun Kwok
Hello list, I am having trouble with match and which giving a NA result for some values, but not others. Here is a simple example: aaa - seq(0,1,by=0.05) aaa [1] 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 [16] 0.75 0.80 0.85 0.90 0.95 1.00 match(0.5,aaa)

Re: [R] Big data and column correspondence problem

2011-07-27 Thread murilofm
Thanks Daniel, that helped me. Based on your suggestions I built this final code: library(foreign) library(gdata) AA = c(4,4,4,2,2,6,8,9) A1 = c(3,3,11,5,5,7,11,12) A2 = c(3,3,7,3,5,7,11,12) A = cbind(AA, A1, A2) BB = c(2,2,4,6,6) B1 =c(5,11,7,13,NA) B2 =c(4,12,11,NA,NA) B3

[R] color of error bars in Dotplot (Hmisc)

2011-07-27 Thread Irene Prix
Hello! In a grouped Dotplot, is there any way to set the color of error bars to be the same as the corresponding symbols? Example data: require(lattice) require(Hmisc) data(barley) Dotplot(variety~Cbind(yield, yield+2, yield-2)|year, groups=site, data=barley) I experimented with changing

Re: [R] Big data and column correspondence problem

2011-07-27 Thread Daniel Malter
If A has more columns than in your example, you could always try to only merge those columns of A with B that are relevant for the merging. You could then cbind the result of the merging back together with the rest of A as long as the merged data preserved the same order as in A. Alternatively,

Re: [R] match and which give NA for some values, but not others

2011-07-27 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Heemun Kwok Sent: Tuesday, July 26, 2011 8:50 PM To: r-help@r-project.org Subject: [R] match and which give NA for some values, but not others Hello list, I am having trouble

Re: [R] Correlated Multivariate Distribution Generator

2011-07-27 Thread Enrico Schumann
Hi Yue Yu, similar questions have been discussed several times on this list; you may want to search the archives. Do you mean linear correlation, or rank correlation? In general, a given linear correlation will not always be attainable (though in your case, it probably will). If _rank_

Re: [R] match and which give NA for some values, but not others

2011-07-27 Thread Rolf Turner
You are failing to take account of floating point arithmetic. This is FAQ 7.31. Really, it is advisable to check the FAQ before firing off a naive inquiry to the r-help list. cheers, Rolf Turner On 27/07/11 15:50, Heemun Kwok wrote: Hello list, I am having trouble with match and

[R] Elegant way to subtract matrix from array

2011-07-27 Thread steven mosher
there are really two related problems here I have a 2D matrix A - matrix(1:100,nrow=20,ncol =5) S - matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2 rows of #A, then the next two rows and so on. #I have a the same problem with a 3D

[R] Plotting a function that includes logical operators

2011-07-27 Thread dean123
I am trying to plot the following function over the range 0-100 test - function(t){{ if (t=10) x-t*0 else x-2*t } x } when I use plot(test,0,100) the GUI produces the following; Warning message: In if (t = 10) x - t * 0 else x - 2 * t : the condition has length 1 and only the first element

[R] Reorganize(stack data) a dataframe inducing names

2011-07-27 Thread Francesca
Dear Contributors, thanks for collaboration. I am trying to reorganize data frame, that looks like this: n1.Index DatePX_LASTn2.Index Date.1 PX_LAST.1 n3.Index Date.2 PX_LAST.2 1 NA04/02/071.34 NA 04/02/07 1.36

[R] RODBC sqlSave problem with bigint numbers

2011-07-27 Thread PtitBleu
Hello, After a (bad) first try some months ago, I'm trying again to use RODBC package instead of DBI+RMySQL packages to populate MySQL database. The main command is sqlSave(channel, data_df, tablename, append=T, rownames=FALSE, colnames=FALSE, fast=FALSE, varTypes=vartypes) where data_df is the

[R] Question re the plotrix package

2011-07-27 Thread Paul Johnson
Dear list, I am using the  clock24.plot command in this excellent package to plot animal activity data. Does anyone know if both symbols and a line can be plotted on the same plot to show both raw data (symbols) and a line (describing a statistical model of the pattern) ? Or if more than

Re: [R] Help with boxplot

2011-07-27 Thread Tia Molte
Bert thanks. Ok I have read the help file. I have only a table with a series of data and not a function. There is a way to create the correct function starting from the table? Sorry but these are my first steps with R ... Thanks Tia Molte -- View this message in context:

Re: [R] GLM different results with the same factors

2011-07-27 Thread gaiarrido
Ok, thanks, I've been reading these days about what you tell me, but i don't understand properly. How could I know, with this tests, which variables are significant? I know my dependent variable depends on the lcc and on the edadysexo. but only one per test seems to be significant. Thanks again

[R] Represent column in a loop

2011-07-27 Thread hrishi
Hello frnds, I have a data file with following coloumns: Drug_A Drug_B P_value odds my question is i have to plot a qplot of drug_A vs Drug_b. considering the p_value and odds. The result should have all the drugs both A and B on axis but dots should be seen only if p_value if 0.05 i

Re: [R] Elegant way to subtract matrix from array

2011-07-27 Thread Gavin Simpson
On Wed, 2011-07-27 at 01:06 -0700, steven mosher wrote: there are really two related problems here I have a 2D matrix A - matrix(1:100,nrow=20,ncol =5) S - matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2 rows of #A,

Re: [R] Question re the plotrix package

2011-07-27 Thread Jim Lemon
On 07/27/2011 04:57 PM, Paul Johnson wrote: Dear list, I am using the clock24.plot command in this excellent package You've won me to plot animal activity data. Does anyone know if both symbols and a line can be plotted on the same plot to show both raw data (symbols) and a line

[R] how to replace values in x by means in subgroups created in ... (not loops)

2011-07-27 Thread Eugeniusz Kałuża
# Dear all, # how to replace values in x by means in subgroups created in ... # replace only these values where y=0 in continous sequence # replace by mean calculated locally for each subgroup created by # continous sequence of 0,0,0 in parallel y vector, i.e. # where there is continous

Re: [R] Elegant way to subtract matrix from array

2011-07-27 Thread steven mosher
Cool, I looked at sweep but didnt consider it as I thought it was restricted to certain functions. So thanks for that solution. yes the data is very large and the future work will increase 10 fold, as for the matrix one I'm not too keen on replicating the smaller matrix, I've had one guy

Re: [R] Comparing two pdf resulting from density() and identify where significantly smaller or larger?

2011-07-27 Thread Rainer M Krug
Sorry for re-iterating - but are there any suggestions on how I could tackle this problem? Thanks, Rainer On Tue, Jul 26, 2011 at 2:58 PM, Rainer M Krug r.m.k...@gmail.com wrote: Hi this might be a little bit off topic, but here it goes: lets assume I have the following:

Re: [R] how to replace values in x by means in subgroups created in ... (not loops)

2011-07-27 Thread ONKELINX, Thierry
Something like this? dataset - data.frame(x = x, y = y) dataset$Group - cumsum(c(0, diff(!is.na(dataset$y) dataset$y == 0)) == 1) library(plyr) tmp - ddply(subset(dataset, y == 0), .(Group), function(z){c(Mean = mean(z$x, na.rm = TRUE))}) result - merge(dataset, tmp) result$Mean[is.na(result$y)

Re: [R] Elegant way to subtract matrix from array

2011-07-27 Thread Gabor Grothendieck
On Wed, Jul 27, 2011 at 4:06 AM, steven mosher mosherste...@gmail.com wrote: there are really two related problems here I have a 2D matrix A - matrix(1:100,nrow=20,ncol =5) S - matrix(1:10,nrow=2,ncol =5) #I want to subtract S from A. so that S would be subtracted from the first 2

Re: [R] Reorganize(stack data) a dataframe inducing names

2011-07-27 Thread Jim Lemon
On 07/27/2011 06:28 PM, Francesca wrote: Dear Contributors, thanks for collaboration. I am trying to reorganize data frame, that looks like this: n1.Index DatePX_LASTn2.Index Date.1 PX_LAST.1 n3.Index Date.2 PX_LAST.2 1 NA04/02/071.34

Re: [R] Elegant way to subtract matrix from array

2011-07-27 Thread steven mosher
Thanks Gabor! On Wed, Jul 27, 2011 at 3:08 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Jul 27, 2011 at 4:06 AM, steven mosher mosherste...@gmail.com wrote: there are really two related problems here I have a 2D matrix A - matrix(1:100,nrow=20,ncol =5) S -

[R] Use a list to 'transport' a collection of data sets and results

2011-07-27 Thread christiaan pauw
Hi Everybody I need to transport some data and results to use another application (Sweave via LyX - where debugging is very difficult) in order to build a report. Is it possible to store a collection of variables of different types (like named integers, matricies, data frames and two lists) all

Re: [R] Elegant way to subtract matrix from array

2011-07-27 Thread Erich Neuwirth
A-kronecker(rep(1,10),S) kronecker(m1,m2) creates a tiled matrix each element of m1 in replaced by m2 multiplied with the element of m1 m1 = (1 2) (3 4) m2 = (11 12) (13 14) kronecker(m1,m2) therefore is 1 * (11 12)2 * (11 12) (13 14)(13 14) 3 * (11 12)

[R] Converting F-value from ANOVA to cohen's d in meta-analysis (metafor-package)

2011-07-27 Thread Jokel Meyer
Dear R-experts! Running a meta-analysis (using the magnificent metafor-package), I use cohen's d as a main outcome measure in a random-effects model. For most of the samples cohen's d is derived form a comparison of two groups (A B). However some studies report results from an ANOVA (one-factor

[R] plotting the ending point in a for loop

2011-07-27 Thread Rebecca Gray
Hello, I would appreciate if someone could help me with this query. I would like to plot a line chart of all of the points in a for loop. I would also like to plot the final point with a symbol (to show where the random walk ends). Here is the code I am using: Brownian.fn - function(mu, sigma,

[R] ADONIS triple interaction

2011-07-27 Thread Jorge
Hi, I am a set data (bird abundance) from a a complete factorial scheme with three factors (Age, Site and Management) and two treatments per factor. Each combination of the factors was replicated four times (a total of 32 stands). I am trying to use ADONIS (vegan) to check whether bird

Re: [R] RODBC sqlSave problem with bigint numbers

2011-07-27 Thread PtitBleu
I've just tested with 12 figures instead of 13. And it works ... But I'm not able to modify these numbers as they are codes given by other guys (and women as well) to distinguish equipments. And I thought the limit with R was 15 digits and not 13. Is it a (bad for me) special feature of the

[R] [R-pkgs] kinship2

2011-07-27 Thread Sinnwell, Jason P.
Dear useRs: Announcing the release of kinship2, version 1.2.1, to CRAN. kinship2 is a branch from the original kinship package with some key updates for the pedigree and kinship functions, with some additional functions that work with the pedigree object. Highlights: * pedigree and

Re: [R] Plotting a function that includes logical operators

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 3:01 AM, dean123 wrote: I am trying to plot the following function over the range 0-100 test - function(t){{ if (t=10) x-t*0 else x-2*t } x } Two problems I see. The first is the one described fairly clearly by the error message: Read: ?if It is not designed to

Re: [R] Help with boxplot

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 3:17 AM, Tia Molte wrote: Bert thanks. Ok I have read the help file. I have only a table with a series of data and not a function. There is a way to create the correct function starting from the table? Sorry but these are my first steps with R ... You appear to be

Re: [R] Use a list to 'transport' a collection of data sets and results

2011-07-27 Thread Dieter Menne
christiaan pauw-2 wrote: Hi Everybody Is it possible to store a collection of variables of different types (like named integers, matricies, data frames and two lists) all in one list and save it and then simply load it again later and unpack the variables. The easy way out is not to

Re: [R] Comparing two pdf resulting from density() and identify where significantly smaller or larger?

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 5:36 AM, Rainer M Krug wrote: Sorry for re-iterating - but are there any suggestions on how I could tackle this problem? You could start by providing an operational definition for identity the areas where d.all is significantly larger then d.co and where it is

Re: [R] Reorganize(stack data) a dataframe inducing names

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 4:28 AM, Francesca wrote: Dear Contributors, thanks for collaboration. I am trying to reorganize data frame, that looks like this: n1.Index DatePX_LASTn2.Index Date.1 PX_LAST.1 n3.Index Date.2 PX_LAST.2 1 NA04/02/07

[R] lattice overlay

2011-07-27 Thread Ram H. Sharma
Dear experts: I want to overlay lattice scatter plot: I do not know why the following code is not plotting subscripts ! Sorry if this question is too simple: require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y,

Re: [R] Use a list to 'transport' a collection of data sets and results

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 6:27 AM, christiaan pauw wrote: Hi Everybody I need to transport some data and results to use another application (Sweave via LyX - where debugging is very difficult) in order to build a report. Is it possible to store a collection of variables of different types

[R] Neighbouring structure of school districts

2011-07-27 Thread Shant Ch
Hello R Users, I wanted to find the weights and adjacency matrix of texas that can be used in Openbugs. library(spdep) library(maps) library(maptools) tx_shape-readShapePoly(.\\Districts_10_11.shp) tx_nb-poly2nb(tx_shape) There is a command called dnearneigh in spdep but is not useful

Re: [R] Comparing two pdf resulting from density() and identify where significantly smaller or larger?

2011-07-27 Thread Rainer M Krug
On Wed, Jul 27, 2011 at 2:09 PM, David Winsemius dwinsem...@comcast.netwrote: On Jul 27, 2011, at 5:36 AM, Rainer M Krug wrote: Sorry for re-iterating - but are there any suggestions on how I could tackle this problem? You could start by providing an operational definition for identity

[R] : Re: coxme frailty model standard errors?

2011-07-27 Thread Terry Therneau
-- begin included message -- Hi, but why we do the difference : ltemp - 2 * diff(tfit $loglik[1:2]) ?? Where I can find information about Integrate Likelihooh and null like lihood?? --- end inclusion --- 1. Basic statistical fact: 2 * difference in loglik between two nested models =

Re: [R] RODBC sqlSave problem with bigint numbers

2011-07-27 Thread Renaud Lancelot
Why don't you read/write this field as a character string? Pretty common for codes. 2011/7/27 PtitBleu ptit_b...@yahoo.fr I've just tested with 12 figures instead of 13. And it works ... But I'm not able to modify these numbers as they are codes given by other guys (and women as well) to

Re: [R] color of error bars in Dotplot (Hmisc)

2011-07-27 Thread Dieter Menne
Irene Prix wrote: In a grouped Dotplot, is there any way to set the color of error bars to be the same as the corresponding symbols? ... require(lattice) require(Hmisc) data(barley) Dotplot(variety~Cbind(yield, yield+2, yield-2)|year, groups=site, data=barley) Customizations of

Re: [R] Ordinary Least Products regression in R

2011-07-27 Thread B77S
If this is the same as geometric mean regression (aka: line of organic correlation-- Kruskal 1953), I ended up writing my own function (although one may exist and I didn't see it). Bill Hyman wrote: Dear all, Does any one know if any R package or function can do Ordinary Least

Re: [R] nls - can't get published AICc and parameters

2011-07-27 Thread Roland Sookias
I also see you divided the body mass by the mass at time zero - why was that? Thanks so much for trying to help. On Wed, Jul 27, 2011 at 1:08 AM, Ben Bolker bbol...@gmail.com wrote: Roland Sookias r.sookias at gmail.com writes: Hi I'm trying to replicate Smith et al.'s

Re: [R] lattice overlay

2011-07-27 Thread Dieter Menne
Ram H. Sharma wrote: I want to overlay lattice scatter plot: I do not know why the following code is not plotting subscripts ! Sorry if this question is too simple: Working example shortened: .panel.xyplot(x, y, pch=16, col = green4, ylim = c(0, 10)) Because they are out of

Re: [R] nls - can't get published AICc and parameters

2011-07-27 Thread Ben Bolker
summary(n1) Formula: LBM ~ c0 * time^gamma Parameters: Estimate Std. Error t value Pr(|t|) c0 2.584780.36767 7.030 8.93e-06 *** gamma 0.292570.03781 7.738 3.21e-06 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7124 on

[R] Expression: +/-sigma

2011-07-27 Thread ogbos okike
Dear List, I am trying to label a plot with the symbol +/- sigma. Using something like - expression (2*sigma) gives me the symbol 2ó. However, adding +/- to it beats me. The code I am using is: plot(x,y,type=l,main= expression(paste(±, plain(2*ó)),sep=). Any suggestion will be appreciated. Best

Re: [R] Expression: +/-sigma

2011-07-27 Thread Yves REECHT
Hi, You may try something like: plot(rnorm(10), rnorm(10), main=expression( %+-% 2*sigma)) HTH, Yves Le 27/07/2011 14:57, ogbos okike a écrit : Dear List, I am trying to label a plot with the symbol +/- sigma. Using something like - expression (2*sigma) gives me the symbol 2ó.

Re: [R] Expression: +/-sigma

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 8:57 AM, ogbos okike wrote: Dear List, I am trying to label a plot with the symbol +/- sigma. Using something like - expression (2*sigma) gives me the symbol 2ó. However, adding +/- to it beats me. The code I am using is: plot(x,y,type=l,main= expression(paste(±,

[R] How to adjust y-axis when using panel.densityplot within histogram function

2011-07-27 Thread Sébastien Bihorel
Hi I would like to superimpose group-specific densityplots on top of an overall histogram using panel.histogram and panel.densityplot. Furthermore, I would like to automatically adjust the range of the y-axis to take into account the ranges of both histogram and densityplot. This last part is

[R] Fixed: Expression: +/-sigma

2011-07-27 Thread ogbos okike
Hi Yves, Many thanks. Very straight forward, the way you put. Best regards Ogbos On 27 July 2011 15:13, Yves REECHT yves.ree...@gmail.com wrote: ** Hi, You may try something like: plot(rnorm(10), rnorm(10), main=expression( %+-% 2*sigma)) HTH, Yves Le 27/07/2011 14:57, ogbos okike a

Re: [R] Converting F-value from ANOVA to cohen's d in meta-analysis (metafor-package)

2011-07-27 Thread Viechtbauer Wolfgang (STAT)
Dear Jokel, Unfortunately, this won't work. The derivation of the equation given in the Handbook shows why this is so. First of all, note that d = (m1 - m2) / sp, where m1 and m2 are the means of the two groups and sp is the pooled SD. The two independent samples t-test (assuming

Re: [R] How to adjust y-axis when using panel.densityplot within histogram function

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 9:15 AM, Sébastien Bihorel wrote: Hi I would like to superimpose group-specific densityplots on top of an overall histogram using panel.histogram and panel.densityplot. Furthermore, I would like to automatically adjust the range of the y-axis to take into account the

Re: [R] Plotting problems directional or rose plots

2011-07-27 Thread alanm (Alan Mitchell)
I'm not sure if there are any packages that do this, but I've created similar plots in R. The easiest way I've found is to think in terms of a unit circle in polar coordinates for drawing the plot. I haven't tested the code below, but it will give you the idea. dist=dist/9000 t =

Re: [R] Help with boxplot

2011-07-27 Thread Bert Gunter
Tia: R is a statistical/data analysis/graphics programming language. There is a learning curve that you appear unwilling to climb. If I have misjudged you, please work through the Introduction to R tutorial. It will provide the information your need. If not, install R-Commander or another R GUI

[R] Inversions in hierarchical clustering were they shouldn't be

2011-07-27 Thread Jonas Dehairs
Hi, I'm using heatmap.2 to cluster my data, using the centroid method for clustering and the maximum method for calculating the distance matrix: library(gplots) library(RColorBrewer) test - matrix(c(0.96, 0.07, 0.97, 0.98, 0.50, 0.28, 0.29, 0.77, 0.08, 0.96, 0.51, 0.51, 0.14,

[R] replacing elements of vector through elements of another vector

2011-07-27 Thread Marcus Mund
Hello everybody, I hope this question is not too silly but I'm almost going crazy about that and could not find a solution. I have two variables, say A and B and I would like to combine them in C. In particular I want a C-value of B when B is not NA and the A value in case that B is NA: A B

[R] Referencing a column using a function argument

2011-07-27 Thread Lin, YunHui
Hi all, I've been having trouble with something that seems like it should be fairly straight forward. Any help at all from more experienced users is appreciated! I'd like to write a function that uses a column name as an argument. However, I run into problems when I try to reference this

[R] tsDyn package (TVAR usage)‏

2011-07-27 Thread francesca.brusa
Hi, I'm using the tsDyn package to estimate a multivariate threshold VAR. Currently, I'm in trouble with the selection of an external transition variable. I cannot select it properly. My xls spreadsheet (rates3) contains 3 variables: I want to use the first and the second one as data and the third

Re: [R] replacing elements of vector through elements of another vector

2011-07-27 Thread Marc Schwartz
On Jul 27, 2011, at 9:52 AM, Marcus Mund wrote: Hello everybody, I hope this question is not too silly but I'm almost going crazy about that and could not find a solution. I have two variables, say A and B and I would like to combine them in C. In particular I want a C-value of B when B

Re: [R] How to adjust y-axis when using panel.densityplot within histogram function

2011-07-27 Thread Sébastien Bihorel
Thanks David, Unfortunately, that is an option that I cannot use. The code that I provided was a simplification of a more complex workflow that accommodates various types of histograms (count, density or percentage). The actual panel function of my histogram call contains several switches that

Re: [R] Referencing a column using a function argument

2011-07-27 Thread Eik Vettorazzi
Hi, use tableName[[columnName]] without quotes, e.g. tableName[[columnName]] # see ?[[ and indexing is done via x-length(tableName[[columnName]][tableName[[columnName]] 6] ) but you may consider x-sum(tableName[[columnName]]6) which saves some time and typing Hth. Am 27.07.2011 17:22,

Re: [R] replacing elements of vector through elements of another vector

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 10:52 AM, Marcus Mund wrote: Hello everybody, I hope this question is not too silly but I'm almost going crazy about that and could not find a solution. I have two variables, say A and B and I would like to combine them in C. In particular I want a C-value of B when B

[R] R Remote Procedure Call

2011-07-27 Thread xiagao1982
Hi all, I have written some functionalities in C# and want to call them in R, maybe from another machine. I have found the following methods: 1. wrapper the C# code as Web Service: I noticed that there is a package named SSOAP, but it seems not yet finished and might be not fully compatible

Re: [R] Correlated Multivariate Distribution Generator

2011-07-27 Thread Doran, Harold
Do you mean something like this? cors - matrix(c(1, .9, .8, .8, .9, 1, .8, .8, .8, .8, 1, .9, .8, .8, .9, 1), 4) L - chol(cors) N - 1000 dat - cbind(rnbinom(N, mu = 4, size = 1), rnbinom(N, mu = 4, size = 1), rnbinom(N, mu = 4, size = 1), rnbinom(N, mu = 4, size = 1)) result - dat %*% L

[R] Suppressing messages while executing function

2011-07-27 Thread Megh Dal
Dear all, while executing some function, there are some custom messages popping up onto the R console and I do not want to see them. While looking into the corresponding codes of those function, I see that those are coming from message() function. Is there any way to stop those messages coming

Re: [R] Suppressing messages while executing function

2011-07-27 Thread Duncan Murdoch
On 27/07/2011 12:50 PM, Megh Dal wrote: Dear all, while executing some function, there are some custom messages popping up onto the R console and I do not want to see them. While looking into the corresponding codes of those function, I see that those are coming from message() function. Is

Re: [R] color of error bars in Dotplot (Hmisc)

2011-07-27 Thread Peter Ehlers
On 2011-07-27 05:35, Dieter Menne wrote: Irene Prix wrote: In a grouped Dotplot, is there any way to set the color of error bars to be the same as the corresponding symbols? ... require(lattice) require(Hmisc) data(barley) Dotplot(variety~Cbind(yield, yield+2, yield-2)|year, groups=site,

[R] Creating a flat legend 'grob' for lattice xyplot

2011-07-27 Thread Mark
Hi, I want my xyplot legend to be flat, not tall, and there seems to be no way for xyplot's auto.key and key elements to do this: I tried many, many permutations of what I could find in the archives and reading the documentation. If there there's a way to make it flat, please tell me what the

Re: [R] Message for R-help mailing list

2011-07-27 Thread Uwe Ligges
On 27.07.2011 02:17, Jeremy Miles wrote: This is clearly a message for the R-help mailing list, since it was sent to the R help mailing list. fisher.test(x)[1] Since the test object is actually a list, your probably want fisher.test(x)[[1]] or more obvious fisher.test(x)[[p.value]] Uwe

Re: [R] Creating a flat legend 'grob' for lattice xyplot

2011-07-27 Thread Gesmann, Markus
Hi Mark, I believe the argument you are looking for is column not ncol. Try the following: library(lattice) xyplot(1~1, auto.key=list( bty='n', pch=rep(c(15,17),2), col=c('brown','green','blue','red'), columns=4, text=c('How','to make','this into', 'a grob?'), space=top )) Regards

Re: [R] R on Multicore for Linux

2011-07-27 Thread Uwe Ligges
On 24.07.2011 20:15, Madana_Babu wrote: Hi Lei, Thanks for your solution. It worked. Now I have another query. After creating multiple DF[[i]]'s how do I aggregate them into one data frame say DF (I want to bind all the data frames into one data frame). I have more than 1000 DF[[i]]'s how

Re: [R] scripting qqplot and qqnorm

2011-07-27 Thread Uwe Ligges
On 25.07.2011 07:11, Vihan Pandey wrote: Hi all, I am an R newbie, and I have a question about scripting. I have the following lines which I want to put int\ o a script which I can call from the shell of a Mac/Linux machine : myrns- read.csv(file=/Users/vihan/test.csv,sep=,header=FALSE)

Re: [R] Plotting problems directional or rose plots

2011-07-27 Thread alanm (Alan Mitchell)
I ran the code I sent earlier and there were a few bugs. That's what I get for using my phone to write code. This works a little better. #direction angle-seq(0,350,10) #distance factor extends to dist = sample.int(9000,size=length(angle)) #list of colors, order corrisponds to associated

Re: [R] plotting the ending point in a for loop

2011-07-27 Thread Uwe Ligges
Don't really undertsand, are you looking for points(B2[N], B1[N]) ? Uwe Ligges On 27.07.2011 11:59, Rebecca Gray wrote: Hello, I would appreciate if someone could help me with this query. I would like to plot a line chart of all of the points in a for loop. I would also like to plot the

Re: [R] Creating a flat legend 'grob' for lattice xyplot

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 1:31 PM, Mark wrote: Hi, I want my xyplot legend to be flat, not tall, and there seems to be no way for xyplot's auto.key and key elements to do this: I tried many, many permutations of what I could find in the archives and reading the documentation. If there there's a

Re: [R] Plotting a function that includes logical operators

2011-07-27 Thread dean123
Hi David, I am trying to define t as a single numeric value and not as a vector.. I want the function to realise that if I call test(t) and t is less than equal 10 return zero, if t greater than 10 return 2*t. Am i missing some code in which to define t a numeric value instead of a vector? Also,

Re: [R] plotting the ending point in a for loop

2011-07-27 Thread Jean V Adams
Add this line of code to the end of your function, after the plot() function. points(B1[N], B2[N], pch=16, col=10) Jean `·.,, (((º `·.,, (((º `·.,, (((º Jean V. Adams Statistician U.S. Geological Survey Great Lakes Science Center 223 East Steinfest Road Antigo, WI 54409 USA From:

[R] To Merge or to use Indicator Variables?

2011-07-27 Thread oaxacamatt
Greetings all, I have two sets of data that I would like to investigate. The first is gene/genome related data given different 'cell-states'. The second set of data is relates the genes to a biological pathway. /(I think in pictures so here goes.)/ *dataframe1* gene, cell-state1, cell-state2

Re: [R] Help with boxplot

2011-07-27 Thread oaxacamatt
Jz, guys lay off. I think you are being a little to hard on the poor soul. The manuals are written in computer-eez and some of the tutorials are no better. /If you can't help then don't answer./ In the meantime, Tia, I apologize. But I suggest you try and try a good book or website that

[R] for loop help

2011-07-27 Thread Wilson, Cassandra J
I am having a hard time putting the below into a loop, where it pulls out ppt from all he stations I have versus having to go through and hard code the data to the specific stations. I tried stnID - stnid[which(duplicated(stnid)==FALSE)] for(i in 1:length(stnID)) { ppt[i] -

Re: [R] Creating a flat legend 'grob' for lattice xyplot

2011-07-27 Thread Mark
Hi Marcus, That's almost it! So ncol and column do the same thing in different functions... gah! Because my real use of xyplot I override the default plotting colors and character, autokey doesn't 'know' this, so they don't match. So the addition of the par.settings element is needed (from

[R] Rationale for different Cooks distances in cooks.distance and plot.lm

2011-07-27 Thread S Ellison
Is anyone able to offer a reason that, when using weights in an lm fit, the Cook's distances shown in plot.lm(x, which=4) differ from those calculated by cooks.distance(x) ? I can see that they _are_ different and the code tells me _how_ they differ (essentially, one is using the weights and

[R] create a index.date column

2011-07-27 Thread jose Bartolomei
Dear R users, I created a matrix that tells me the first day of use of a category by id. #Calculate time difference test$tdiff-as.numeric(difftime(as.Date(2002-09-01), test$ftime, units = days)) # obtain the index date per person and dcategory

Re: [R] RODBC sqlSave problem with bigint numbers

2011-07-27 Thread Jason Becker
In fact, I always use a string for ID variables because you can get some funky matching errors due to mismatches in precision. Bill Gould at Stata Corp said this well in a recent blog post 1. Use theory to check IDs if they are numeric One way the id variable can become corrupted is if it is not

[R] Placing brackets around the values in a data frame

2011-07-27 Thread Abraham Mathew
Lets say I have the following data frame. df = data.frame(word = c(David, James, Sara, Jamie, Jon)) df I was trying to place brackets , [ ] , around each string. I'll be exporting it with write.table and quotes=FALSE, so it will eventually look like: [David] [James] [Sara] Can anyone

[R] How to search for R related topics in search engines?

2011-07-27 Thread Paul Menzel
Dear R folks, I am having problems getting good results when searching for R related topics, that means I have not found out yet what keywords I should use to get only relevant results. Most of the time I get also MATLAB related things and nothing related at all. The nature of this is of course

Re: [R] Accessing the index of factor in by() function

2011-07-27 Thread Merik Nanish
On Tue, Jul 26, 2011 at 10:12 AM, Ista Zahn iz...@psych.rochester.edu wrote: OK, easy enough: dat.tmp - data.frame(id, month, value) my.plot - function(dat) {print(dat[, c(id, value)])} by(dat.tmp, id, my.plot) Excellent. The output of that last line is: * id value 1 110 2 112 3

[R] fitting sine wave

2011-07-27 Thread Tonja Krueger
Dear R-helpers   I have 7 data points that I want to fit a continuous curve to, that should look similar to a sine wave My data points would mark the local minima and maxima respectively. This is what I’ve got so far. And I would keep doing so, but sadly nls() then says that it has reached the

[R] Executing for loop by grouping variable within dataframe

2011-07-27 Thread ssobek
Dear list, I have a large dataset which is structured as follows: locality=c(USC00020958, USC00020958, USC00020958, USC00020958, USC00020958, USC00021001,USC00021001, USC00021001, USC00021001, USC00021001, USC00021001) temp.a=c(-1.2, -1.2, -1.2, -1.2, -1.1, -2.2, -2.4, -2.6,-2.7, -2.8, -3.0)

Re: [R] RODBC sqlSave problem with bigint numbers

2011-07-27 Thread PtitBleu
I spent all the day on this problem and I've just finally found a solution: with options(digits=13), it now works. If I hadn't found this, I would have used the solution of Renaud (but not very convenient to me). Nice end of day, (Happy) Ptit Bleu. -- View this message in context:

Re: [R] Plotting a function that includes logical operators

2011-07-27 Thread Duncan Murdoch
On 27/07/2011 9:21 AM, dean123 wrote: Hi David, I am trying to define t as a single numeric value and not as a vector.. I want the function to realise that if I call test(t) and t is less than equal 10 return zero, if t greater than 10 return 2*t. Am i missing some code in which to define t a

Re: [R] How to search for R related topics in search engines?

2011-07-27 Thread Jeremy Miles
Use rseek.org. Jeremy On 27 July 2011 07:12, Paul Menzel paulepan...@users.sourceforge.net wrote: Dear R folks, I am having problems getting good results when searching for R related topics, that means I have not found out yet what keywords I should use to get only relevant results. Most

Re: [R] Installing CAIC

2011-07-27 Thread Uwe Ligges
On 25.07.2011 19:42, eilunedpearce wrote: Hi, I'm trying to install CAIC directly into the newest version of R using the code on the R-Forge CAIC website and I get an error message: install.packages(CAIC, repos=http://R-Forge.R-project.org;) Warning message: In getDependencies(pkgs,

Re: [R] Placing brackets around the values in a data frame

2011-07-27 Thread Uwe Ligges
On 27.07.2011 20:00, Abraham Mathew wrote: Lets say I have the following data frame. df = data.frame(word = c(David, James, Sara, Jamie, Jon)) df I was trying to place brackets , [ ] , around each string. I'll be exporting it with write.table and quotes=FALSE, so it will eventually look

Re: [R] How to search for R related topics in search engines?

2011-07-27 Thread Duncan Murdoch
On 27/07/2011 10:12 AM, Paul Menzel wrote: Dear R folks, I am having problems getting good results when searching for R related topics, that means I have not found out yet what keywords I should use to get only relevant results. Most of the time I get also MATLAB related things and nothing

Re: [R] Placing brackets around the values in a data frame

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 2:00 PM, Abraham Mathew wrote: Lets say I have the following data frame. df = data.frame(word = c(David, James, Sara, Jamie, Jon)) df I was trying to place brackets , [ ] , around each string. I'll be exporting it with write.table and quotes=FALSE, so it will eventually

[R] Hidden Markov Models in R

2011-07-27 Thread Edward Patzelt
R Community - I am attempting to fit a model as described in Hampton, Bossaerts, and O'doherty (J. Neuroscience) 2006. They use a bayesian hidden markov model to model the Reversal Learning data. I have tried using HMM and depmixS4 with no success. My data is a Reversal Learning Task in which

Re: [R] How to search for R related topics in search engines?

2011-07-27 Thread David Winsemius
On Jul 27, 2011, at 10:12 AM, Paul Menzel wrote: Dear R folks, I am having problems getting good results when searching for R related topics, that means I have not found out yet what keywords I should use to get only relevant results. Most of the time I get also MATLAB related things and

  1   2   >