[R] How to find data in a map according to coordinates?

2012-08-08 Thread jeff6868
Hello, I have created a spatial map of temperature over an area thanks to interpolation. So I have temperature data everywhere on my map. My question is: how can I find temperature data on my map for a specific location according to coordinates? For this, I have a data frame containing 4 columns:

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread Jeff Newmiller
I took a closer look, and unused factor levels is not the problem... the problem is defining id variables appropriately. 1) "sample" is the name of a builtin function, so it is not advisable to use it as the name of data. I have used "samp" instead of "sample" 2) Your input data is essentiall

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread John
On Wed, 8 Aug 2012 18:06:52 -0300 Henrique Andrade wrote: > Dear Arun, > > Thanks a lot for your help, but I really need to save the splitted > data in a Excel file (xlsx or xls). This is because I will need to > make links between different Excel workbooks. > As it is your purpose is unclear.

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread arun
Hi, I tried converting factors to character, but the results still has NAs. convert.type1 <- function(obj,types){     for (i in 1:length(obj)){     FUN <- switch(types[i],character = as.character,    numeric = as.numeric,    fac

Re: [R] Advice: How to best ensure column values match in different vectors?

2012-08-08 Thread R. Michael Weylandt
On Wed, Aug 8, 2012 at 10:58 AM, DG Christensen wrote: > Hello all, I would like some advice on how to order elements in a vector. > > Background: my company is running a k-means clustering model on our > historical data warehouse of products, which will produce a matrix of > cluster centers. The

Re: [R] NULL column

2012-08-08 Thread Silvano Cesar da Costa
Thank you all. Your suggestions solved the problem. > If you original read in the data with read.table, use its > row.names=NULL argument so it doesn't turn the first > character column with no duplicated entries into the > row.names. > >> d <- read.table(text=" > + CAP beta0 beta1

Re: [R] looking for accessibility help (blind student)

2012-08-08 Thread cberry
Peter Petto writes: > I will have a blind student in my AP Statistics class this year. > > I'm thinking about using R as his calculator. It seems like it's core text-in > text-out nature may match screen reading software well. And I'd like to > explore directing visualizations to tactile graphi

[R] Add interpunct (dot) symbol to axis label?

2012-08-08 Thread Hillary Ward
I'm having problems creating an axis label for a plot. y_label = expression(paste(plain('CPUE '),plain('(fish'),plain('x'),plain('h'^{-1}),plain(')'))) I'd like to replace the "x" with an interpunct symbol (dot). Any suggestions how to do this? Thanks in advance. [[alternative HTML vers

Re: [R] NULL column

2012-08-08 Thread arun
Hi Silvano, You can save the data as "filename.txt" and then call read.table() For example, I saved your data: #   beta0  beta1  pvalor    Crom  rs17  158.5980 12.252462 9.083193e-135    1  rs46  163

[R] Fill pattern for Boxplots?

2012-08-08 Thread suse
Is it possible to fill the boxes of a boxplot with filling patterns/texture instead of colours? Or both mixed? (for example white, grey, left diagonal striped, right diagonal striped) How can I do that? I searched here, but didn't find an answer. Thank you! -- View this message in context: htt

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread David Winsemius
On Aug 8, 2012, at 2:16 PM, greatest.possible.newbie wrote: Ok I see that point with the quotes. But what I want to do still doesn't work: a <- matrix(1:15,ncol=3) b <- paste( paste("a[," ,paste(1:3), "]",sep="") ,"^",1:3,sep="",collapse="+") b #[1] "a[,1]^1+a[,2]^2+a[,3]^3" #instead of (wh

Re: [R] Density

2012-08-08 Thread David L Carlson
The numbers are there, they just aren't listed by the default print method for density. When you type the object name, den0, R runs print.density(den0) which provides summary statistics. You need to look at the manual page (?density) and pay close attention to the section labeled "Value" which pro

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread Rich Shepard
On Wed, 8 Aug 2012, Jeff Newmiller wrote: The explanation is that this is normal and consistent with behavior of factors in general. If you don't want that, it is common to work with character data instead of factors, only converting to factor when needed. In most cases I invoke read.table with

Re: [R] Adjusting coordinates in raster plots

2012-08-08 Thread David L Carlson
Like this? r <- raster(ncol=10, nrow=10, xmn=0, ymx=0) values(r) <- mat plot(r) -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.or

Re: [R] R help

2012-08-08 Thread Jeff Newmiller
Please continue to include the r-help list in the conversation... you will most likely get your solution quicker. Why do you have double backslashes? That is needed within R, but not at the command line or in a shortcut. ---

Re: [R] R versus SAS

2012-08-08 Thread Yihui Xie
The Department of Redundancy Department can "recompensate"... Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Wed, Aug 8, 2012 at 5:17 PM, Rolf Turner wrote: > cheers, > > Rolf Tu

[R] Density

2012-08-08 Thread li li
Dear all, Given a set of observations X, I want to evaluate the kernel density estimator at these observed values. If I do the following, I do not get the those estimated values directly. Can anyone familiar with this give an idea on how to find out the estimated density values for X? > X <- rn

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread Henrique Andrade
Dear Rui and David, Thanks a lot for your help and advices. Now finally I have what I want ;-) The final code looks like this: dados <- data.frame(matrix(c("2012-01-01","2012-02-01", "2012-03-01","2012-04-01","2012-05-01","2012-06-01", "2012-01-01","2012-02-01","2012-03-01","2012-04-01",

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread S Ellison
Why do you want to do this via character strings at all? You have at least two alternatives. First, you can pass the exponents as a vector and the data as a matrix and then just do the calculation: f <- function(mat, expon) { apply(mat, 1, function(x, e) sum(x^e), e=expon)

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread Jeff Newmiller
The explanation is that this is normal and consistent with behavior of factors in general. If you don't want that, it is common to work with character data instead of factors, only converting to factor when needed. In most cases I invoke read.table with the as.is=TRUE argument and delay convert

Re: [R] inquire a statistical terms

2012-08-08 Thread S Ellison
>Is there any standard statistical terminology describing the points beyond > a confidence region? 'data'? Sounds flippant, but even for univariate location estimates (a case where parameter estimates and data can be compared directly) a lot of data points are usually outside confidence regio

Re: [R] Overlay Histogram

2012-08-08 Thread baptiste auguie
Hi, On 9 August 2012 08:40, li li wrote: > Dear all, >I have a few extra questions regarding this. Below is my code. > My questions are: > (1), How can I remove the labels, tick marks and numbers, and the word > "density" for the histgrams. > (2) On the top right corner, there is a empty g

Re: [R] Calculating percentages across multiple columns

2012-08-08 Thread Daisy Englert Duursma
Your question is very unclear.Can you provide a better question or at least a column of outputs you expect and an example with the dataframe you provided? On Thu, Aug 9, 2012 at 8:29 AM, Abraham Mathew wrote: > I have the following data and am trying to find the percentage of bid > values purchas

Re: [R] Overlay Histogram

2012-08-08 Thread Peter Ehlers
On 2012-08-08 13:40, li li wrote: Dear all, I have a few extra questions regarding this. Below is my code. My questions are: (1), How can I remove the labels, tick marks and numbers, and the word "density" for the histgrams. Well, you have the solution in your code for the "empty" plot: u

Re: [R] NULL column

2012-08-08 Thread William Dunlap
If you original read in the data with read.table, use its row.names=NULL argument so it doesn't turn the first character column with no duplicated entries into the row.names. > d <- read.table(text=" + CAP beta0 beta1 pvalorCrom + rs17 158.5980 12.252462 9.083193

[R] Question about R and multiple CPU's

2012-08-08 Thread Eberle, Anthony
I have a question about multiple cores and CPU's for running R. I've been running various tests on different types of hardware and operating systems (64 bit, 32 bit, Solaris, Linux, Windows, RV.10, .12, .15, .15.1.) Generally speaking, it seems that for a single user and process that R prefers to

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread Rui Barradas
Hello, First of all, apologies to Henrique, he'll receive th same answer twice, but I forgot to Cc the list. In order to write 3 worksheets you need to create 3 worksheets. What happened is that you were overwriting the previous sheets and ended up just with the last one. So adopt a differen

[R] Calculating percentages across multiple columns

2012-08-08 Thread Abraham Mathew
I have the following data and am trying to find the percentage of bid values purchased for that price. So let's say I have a bid of 5 and it's sold 2 times for $3 and $5. Since the original bid was $5, the percentage of times that that bid value results in a sold purchase AT that specific bid leve

[R] Imputation using package mi

2012-08-08 Thread hazbro
I am unsure if the package mi uses MICE because I can specify the number of iterations for the mi functions. Also on a side note: I have a large data set with 300+ covariates (some are have missing values). So I was wondering if I should use all the complete covariates for the imputation models

Re: [R] NULL column

2012-08-08 Thread arun
HI, Try this: dat1<-read.table(text="     beta0  beta1  pvalor    Crom rs17  158.5980 12.252462 9.083193e-135    1 rs46  163.3730  3.304276  3.279925e-06  1 rs63  162.7924  2.084678  5.023893e-06  1 rs24  162.4252  1.8372

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread arun
HI, The param factor has 54 levels.  So, I guess the combinations that are not present will record as NA. A.K. - Original Message - From: Rich Shepard To: r-help@r-project.org Cc: Sent: Wednesday, August 8, 2012 2:33 PM Subject: Re: [R] reshape2's dcast() Adds NAs to Data Frame On

[R] basehaz() in package 'Survival' and warnings() with coxph

2012-08-08 Thread hazbro
Hello, I have a couple of questions with regards to fitting a coxph model to a data set in R: I have a very large dataset and wanted to get the baseline hazard using the basehaz() function in the package : 'survival'. If I use all the covariates then the output from basehaz(fit), where fit is a m

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread David Winsemius
On Aug 8, 2012, at 1:10 PM, Henrique Andrade wrote: Dear R Discussion List, I would like to save my data as a xlsx file. But at first I need to split it and then save each series into a Excel column. That doesn't make much sense. You have three columns. What are you calling a "series" (whi

Re: [R] reshape2's dcast() Adds NAs to Data Frame

2012-08-08 Thread Rich Shepard
On Wed, 8 Aug 2012, arun wrote: The param factor has 54 levels. So, I guess the combinations that are not present will record as NA. I noticed that but have not found an explanation. I'll work with the base data frame. Thanks, Rich __ R-help@

Re: [R] getting started with R and mysql

2012-08-08 Thread Prof Brian Ripley
On 08/08/2012 18:42, Michael Friendly wrote: I have a mysql database I installed on my Ubuntu server, and I'm trying to figure out how to access and analyze it from a Win XP machine running R 2.15.1. I thought that RMySQL was the way to go. (Is there an easier way?) I tried to follow the instruc

Re: [R] inquire a statistical terms

2012-08-08 Thread Bert Gunter
?? A confidence region for what? Confidence regions refer to parameters and functions of parameters (e.g. means of fitted values) and are completely incommensurate with the scale of the data. It sounds like you are confusing basic concepts (i.e. you don't really understand what a confidence region

Re: [R] R versus SAS

2012-08-08 Thread Rolf Turner
On 08/08/12 14:46, Kjetil Halvorsen wrote: I found this on CrossValidated: "A medical statistician once told me, that they use SAS because if they make mistakes due to software bugs and it comes to lawsuits, SAS will recompensate them. R comes without warranty." If the "medical statistician"

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread greatest.possible.newbie
Ok I see that point with the quotes. But what I want to do still doesn't work: a <- matrix(1:15,ncol=3) b <- paste( paste("a[," ,paste(1:3), "]",sep="") ,"^",1:3,sep="",collapse="+") b #[1] "a[,1]^1+a[,2]^2+a[,3]^3" #instead of (which I want) a[,1]^1+a[,2]^2+a[,3]^3 #[1] 1368 1779 2264 2829 3480

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread Henrique Andrade
Dear Arun, Thanks a lot for your help, but I really need to save the splitted data in a Excel file (xlsx or xls). This is because I will need to make links between different Excel workbooks. Best regards, Henrique Andrade Enviado via iPhone Em 08/08/2012, às 17:25, arun escreveu: > Hi, > > I

[R] Testing for a second order factor using SEM package

2012-08-08 Thread Joaquin (Kino) Aguilar
Hi! The following model specification works when testing for first order factors, but when I attempt to test for a second order factor by adding the last 4 lines in the model, I get the error message below: model.cfa.ru <- specifyModel() sRU1 <- sRU, NA, 1 sRU2 <- sRU, lam12 sRU3 <- sRU, lam13 sR

[R] NULL column

2012-08-08 Thread Silvano Cesar da Costa
Hi, I have a dataset where the first column has no name. I would like to assign a name to this column to be able to use it something like: Cap <- NULL How can I do this? beta0 beta1 pvalorCrom rs17 158.5980 12.252462 9.083193e-135

[R] inquire a statistical terms

2012-08-08 Thread Zhiqiu Hu
Dear all, Is there any standard statistical terminology describing the points beyond a confidence region? Obviously, the "outlier" is improper here. Please help me if you happens have the info. Thanks you very much for your kindly help. Best wishes, Zhiqiu [[alternative HTML version de

Re: [R] Error using ddply inside user-defined function

2012-08-08 Thread Jennifer Sabatier
Thank you Brian and Dennis, for your help. Those solutions worked for a single calculation but I need to replicate it a couple hundred times. This is what worked: This is what I needed: ** allocation <- function(vr1, vr2, vr3) { ** d<- ave(vr1+vr2+vr3, vn$MECH.NAME

Re: [R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread arun
Hi, I think saving it as .csv file will be much easier.  I am getting all the series in the wide format. write.csv(dados2,"dados2.csv") X2005.date X2005.value X2005.code X3939.date X3939.value X3939.code X433.date X433.value X433.code 7 2012-01-01 152136 2005 2012-01-01 33.47 3939 2012-01

[R] Adjusting coordinates in raster plots

2012-08-08 Thread Jan Sudeikat
Dear R-Help, When plotting a raster object the origin (0,0) is placed in the center. E.g. using: library(raster) mat = matrix(runif(100),10,10) r <- raster(ncol=10, nrow=10) values(r) <- mat plot(r, main='Raster example',xlab="x",ylab="y") Does anyone know how to adjust the coordinate system?

Re: [R] NADA Package: Referencing Data Frame Columns

2012-08-08 Thread Rich Shepard
On Wed, 8 Aug 2012, MacQueen, Don wrote: Specifically, since it has only a single detection indicator column (ceneq1), it implies that within any single sample either all the analytes were detected, or all were not. Not what I would expect. Don, I have been thinking about this and wondered

Re: [R] Overlay Histogram

2012-08-08 Thread li li
Dear all, I have a few extra questions regarding this. Below is my code. My questions are: (1), How can I remove the labels, tick marks and numbers, and the word "density" for the histgrams. (2) On the top right corner, there is a empty grid. How can I remove it. Thank you in advance.

Re: [R] map axis on projected shapefiles

2012-08-08 Thread MacQueen, Don
There is no particular requirement to start with decimal degrees in R. You could have started with their original projection, as loaded into R, and reprojected directly to your desired projection (i.e., without the extra step of passing them through ArcGIS). By the way, this would have been a goo

Re: [R] Wilcoxon test

2012-08-08 Thread peter dalgaard
On Aug 8, 2012, at 18:16 , BELLAY Juliette wrote: > Dear list, > > I am facing a problem in my statistical analyses on R. > My experiments are about plants, I record there growth after each cutting > (every 3 weeks). > 'BC' is for the plant, and '1' to '5' is the time of cutting and recording.

[R] Saving Splitted Series to Excel via XLConnect

2012-08-08 Thread Henrique Andrade
Dear R Discussion List, I would like to save my data as a xlsx file. But at first I need to split it and then save each series into a Excel column. Please take a look at the following code: dados <- data.frame(matrix(c("2012-01-01","2012-02-01", "2012-03-01","2012-04-01","2012-05-01","2012-06-0

Re: [R] decimal points midline

2012-08-08 Thread array chip
Thanks Uwe, options(OutDec="\xB7") worked! From: Uwe Ligges To: John Kane roject.org> Sent: Wednesday, August 8, 2012 12:43 PM Subject: Re: [R] decimal points midline On 08.08.2012 21:22, John Kane wrote: > Can you point to an example?  It sounds like the

Re: [R] NADA Package: Referencing Data Frame Columns

2012-08-08 Thread MacQueen, Don
Hi Rich, I may not have the complete picture here, but I do see what looks to me like a problem with your chem.cast. Specifically, since it has only a single detection indicator column (ceneq1), it implies that within any single sample either all the analytes were detected, or all were not. Not w

Re: [R] Alternating between "for loops"

2012-08-08 Thread Claudia Penaloza
Answers inserted in BLUE below On Thu, Aug 2, 2012 at 5:34 PM, Claudia Penaloza wrote: > Thank you very much for all your suggestions. I am very sorry my code is > so crude (it gives me a headache too!), I'm very new to R programing. I > will have to look at your suggestions/questions very carefu

Re: [R] decimal points midline

2012-08-08 Thread Uwe Ligges
On 08.08.2012 21:22, John Kane wrote: Can you point to an example? It sounds like the journal is still using typewriters. Anyway, setting options(OutDec="ALT0183") and replace ALT0183 by the keystrokes your described below or by options(OutDec="\xB7") Best, Uwe Ligges John Kane Ki

Re: [R] decimal points midline

2012-08-08 Thread John Kane
Can you point to an example? It sounds like the journal is still using typewriters. John Kane Kingston ON Canada > -Original Message- > From: arrayprof...@yahoo.com > Sent: Wed, 8 Aug 2012 11:52:27 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] decimal points midline > > Hi, do

Re: [R] Installing HDF5 package

2012-08-08 Thread Martin Morgan
On 08/08/2012 12:10 PM, Uwe Ligges wrote: On 08.08.2012 20:54, John Kane wrote: You have not told us what you have done or what your OS is. In any case R is case sensitive so try: install.packages("hdf5") Which won't work on Windows since binaries are not available under that platform. An

Re: [R] Installing HDF5 package

2012-08-08 Thread Uwe Ligges
On 08.08.2012 20:54, John Kane wrote: You have not told us what you have done or what your OS is. In any case R is case sensitive so try: install.packages("hdf5") Which won't work on Windows since binaries are not available under that platform. Another package brandnew on CRAN is h5r. Bi

Re: [R] Installing HDF5 package

2012-08-08 Thread John Kane
You have not told us what you have done or what your OS is. In any case R is case sensitive so try: install.packages("hdf5") John Kane Kingston ON Canada > -Original Message- > From: saadsihe...@gmail.com > Sent: Wed, 8 Aug 2012 09:25:06 -0700 (PDT) > To: r-help@r-project.org > Subject

[R] decimal points midline

2012-08-08 Thread array chip
Hi, does anyone know how to make decimal points midline when plotting? The journal to which we are going to submit a manuscript require this particular formatting, and it gives direction how to do this on PC: hold down ALT key and type 0183 on the number pad Thanks John [[alternative H

[R] Showing multiple Probability Plots on the same graph using the plot(cenros) command from the NADA library

2012-08-08 Thread plebel
I am currently conducting a performance analysis for an urban stormwater management facility which employs Low Impact Development practices. I have the Event Mean Concentrations (EMCs) of several water quality constituents (ex: Total Phosphorus (TP), Total Oxidized Nitrogen (OxN), etc) at inflow an

[R] mgcv and gamm4: REML, GCV, and AIC

2012-08-08 Thread john benson
Hi, I've been using gamm4 to build GAMMs for exploring environmental influences on genetic ancestry. Things have gone well and I have 2 very straightforward questions: 1. I've used method=REML. Am I correct that this is an alternative method for estimating the smooth functions in GAMMs rather

Re: [R] summing and combining rows

2012-08-08 Thread arun
Hello, I tried with ddply  ddply(dat1,.(Data,Plot,Lat,LatCat,Elevation,Type,Area,Density),summarize,sum(Stems))   Data  Plot  Lat LatCat Elevation    Type Area  Density ..1 1  VTM 39C16 39.76282   Lat6  1500 Conifer 751.5347  0.0   0 2  VTM 39C16 39.76282   Lat6  1500 Conifer

Re: [R] summing and combining rows

2012-08-08 Thread arun
HI, From the ?aggregate(), formula: a formula, such as ‘y ~ x’ or ‘cbind(y1, y2) ~ x1 + x2’,   where the ‘y’ variables are numeric data to be split into   groups according to the grouping ‘x’ variables (usually   factors). So, I converted your data to factors for the grou

[R] Wilcoxon test

2012-08-08 Thread BELLAY Juliette
Dear list, I am facing a problem in my statistical analyses on R. My experiments are about plants, I record there growth after each cutting (every 3 weeks). 'BC' is for the plant, and '1' to '5' is the time of cutting and recording. The data and R script are : "" BourdCoup <- c(21, 7.2, 9.2, 0,

Re: [R] Cannot create Java virtual machine (-1)

2012-08-08 Thread Martin Studer
Hi Roger, note that since version 0.1-7 of XLConnect Java 1.6 is required - it won't work with Java 1.5. However, the problem you describe is another one. It's most likely related to your Java setup/configuration and therefore independent of XLConnect. You can verify this by running the following

Re: [R] help to program my function

2012-08-08 Thread hafida
hi peter the pdf folder is in http://r.789695.n4.nabble.com/file/n4639434/aj.pdf -- View this message in context: http://r.789695.n4.nabble.com/help-to-program-my-function-tp4639434p4639629.html Sent from the R help mailing list archive at Nabble.com. _

[R] Installing HDF5 package

2012-08-08 Thread sihemsaad
Dear all I am a new user of R and I have been trying to install the HDF5 package but I don't seem to find any easily. I tried looking in the archives but I didn't succeed in installing the packages there. I guess they must be for Unix If any body succeeded in installing this library, please give

[R] Advice: How to best ensure column values match in different vectors?

2012-08-08 Thread DG Christensen
Hello all, I would like some advice on how to order elements in a vector. Background: my company is running a k-means clustering model on our historical data warehouse of products, which will produce a matrix of cluster centers. Then, on our production web servers, we will take newly created prod

Re: [R] getting started with R and mysql

2012-08-08 Thread Curt Seeliger
> I have a mysql database I installed on my Ubuntu server, and I'm trying > to figure out how to access and analyze it > from a Win XP machine running R 2.15.1. > > I thought that RMySQL was the way to go. (Is there an easier way?) We use RODBC. Is there a reason that won't work? cur -- Curt

[R] getting started with R and mysql

2012-08-08 Thread Michael Friendly
I have a mysql database I installed on my Ubuntu server, and I'm trying to figure out how to access and analyze it from a Win XP machine running R 2.15.1. I thought that RMySQL was the way to go. (Is there an easier way?) I tried to follow the instructions at http://www.r-bloggers.com/installi

Re: [R] label_wrap_gen question

2012-08-08 Thread Brian Diggs
On 8/8/2012 12:30 AM, vd3000 wrote: Hi, Brian So, I could only rename the label by myself such as Light and heavy\ngood vehicles (diesel) -\nGVX in order to get Light and heavy good vehicles (diesel) - GVX Right? First an etiquette comment: it is customary to quote context when replying t

Re: [R] Interpreting predictions of svm

2012-08-08 Thread Camille Hénaff
Jessica- Thanks for responding quickly to me; I have fund a solution to my problem this morning. Kind regards, Camille [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread Jeff Newmiller
The quotes shown on a string when you print it are artifacts of making the string usable in source code... they are not present in the string as it is stored in memory. (Same goes for escape sequences, such that "\n" occupies one byte of UTF8 storage.) You can use the cat function to send the s

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread Rui Barradas
Hello, The other problem with the boxplot question is that it's ill defined. Those data[,1], ..., data[, n] variables, what are they? All of them numeric? If so, then where is the factor? Some time ago there was a question on multiple boxplots with cut() defining the factor. I wrote a benera

Re: [R] Pass Conditional & loop argument into a function

2012-08-08 Thread greatest.possible.newbie
Thank you for your improvement suggestions. I forgot to write the I() and it's clear that I have to specify the data (which I was indicating with the '...' without explicitly writing it). In this special case where I need a formula you really helped me with the function as.formula() to transform t

Re: [R] R help

2012-08-08 Thread Jeff Newmiller
There seem to be too many quotes in your error message... the path and name of the program should be quoted, the argument should not (or should be separately quoted). 500M isn't especially large these days... be sure to check your existing (default) value using the memory.limit() function befor

Re: [R] ggplot2 with separate average lines

2012-08-08 Thread John Kane
Looks like it works :) I'd suggest not using attach(). It can cause problems in some cases. gglot2 is set up to read the relevant data frame so p <- ggplot( data , aes( Whatever. )) + and so on However "data" is a defined function in R so something like mydata or df1 is a better choice.

Re: [R] Confidence bands around LOESS

2012-08-08 Thread Bert Gunter
Please Note: loess() is a fitting algorithm, so no parameters are estimated and no _confidence_ intervals nor bands can be produced. What predict.loess() _does_ give is standard errors for the fits/predictions, and you can add and subtract as many of these as you like to produce standard error b

Re: [R] dimnames in array

2012-08-08 Thread David Winsemius
On Aug 8, 2012, at 8:43 AM, aleksandr russell wrote: Hi again, Thanks for your suggestion. I think I can clarify the thing by looking at the bare bones: data11 = array(0,c(41,2,2)) m8<-cbind(.29,1:41) m9<-as.array(m8,dim=c(41,2)) data11[,1,]=m9 data11[

Re: [R] Setting Number of Displayed Digits

2012-08-08 Thread Rich Shepard
On Tue, 7 Aug 2012, arun wrote: formatC() may work for you. Thanks for the lesson. Rich __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Confidence bands around LOESS

2012-08-08 Thread John Kane
I may have missed something entirely but I think ggplot2 will do this for you pretty well automatically library(ggplot2) mydata <- read.csv("http://doylesdartden.com/smoothing.csv";, sep=",") p <- ggplot(mydata , aes( X_Axis_Parameter, Y_Axis_Parameter )) + geom_point() + geom_

[R] ggplot2 with separate average lines

2012-08-08 Thread Alan Miller
Hi I'm just starting off with R but is this correct? I have this data set. > data Type ID Size 1 Reqd 244808 1024 2 Reqd 244045 512 3 Reqd 245427 800 4 Reqd 245423 1024 5 Reqd 244983 1024 6 Used 244808 615 7 Used 244045 33 8 Used 245427 261 9 Used 245423 461 10 Used 244983 1

Re: [R] sapply and matrix command

2012-08-08 Thread alijk1989 [via R]
Hi Michael, Thanks for your response. Here is a simple example of what I am trying to do: w=rep(0.02,10) Q=rep(0.02,10) rho=matrix(0.5,nrow=10,ncol=10) m=10 LGD=0.45 M1=sum(sapply(1:m, function(k){sum(sapply(1:m,function(j){w[k]*w[j]*LGD^2*(pmnorm(c(qnorm(Q[k]),qnorm(Q[j])),c(0,0),equicorr(2,r

[R] R help

2012-08-08 Thread chong hui qi
Hi I'm trying to increase the memory limit but Im facing this problem "Error: unexpected symbol in ""C:\\Program Files\\R\\R-2.15.0\\bin\\i386\\Rgui.exe" --max-mem-size=500M" " Hope you can help me out Thank You [[alternative HTML version deleted]] __

Re: [R] dimnames in array

2012-08-08 Thread aleksandr russell
Hi again, Thanks for your suggestion. I think I can clarify the thing by looking at the bare bones: data11 = array(0,c(41,2,2)) m8<-cbind(.29,1:41) m9<-as.array(m8,dim=c(41,2)) data11[,1,]=m9 data11[,2,]=m9 varnames=c("V","R") colnames(dat

Re: [R] help to program my function

2012-08-08 Thread Petr PIKAL
Hi please cc your post also to Rhelp list, others may give you better/quicker answer. > > > HI peter > there is the function that i want to programm (joint in pdf folder). No pdf allowed. > my data is > dataexpv Ti1 265.792 26 1579.523 26 2323.704 > 28 68.855 28 426.07

[R] Odp: help, please! matrix operations inside 3 nested loops

2012-08-08 Thread Petr PIKAL
Hi > > hello, this is my script: > > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', > header=TRUE, sep="\t") > daten<-as.matrix(daten) If there is any column with nonnumeric values it will transfer all numeric values from daten data.frame

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-08 Thread Berend Hasselman
Fridolin wrote > > hello, this is my script: > > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', > header=TRUE, sep="\t") > daten<-as.matrix(daten) > > #2) create empty matrix: > indxind<-matrix(nrow=617, ncol=617) > indxind[1:20,1:19] >

Re: [R] help to program my function

2012-08-08 Thread hafida
HI peter there is the function that i want to programm (joint in pdf folder). my data is > dataexpv Ti1 265.792 26 1579.523 26 2323.704 28 68.855 28 426.076 28 110.297 28 108.298 28 1067.609 30 17.0510 30 22.6611 30 21.0212 30 175.8813 30 139.0714 30 144.1215

Re: [R] help, please! matrix operations inside 3 nested loops

2012-08-08 Thread R. Michael Weylandt
On Wed, Aug 8, 2012 at 9:06 AM, Fridolin wrote: > hello, this is my script: > > #1) read in data: > daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', > header=TRUE, sep="\t") > daten<-as.matrix(daten) > > #2) create empty matrix: > indxind<-matrix(nrow=617, ncol=617

Re: [R] time series, uneven length

2012-08-08 Thread R. Michael Weylandt
On Wed, Aug 8, 2012 at 7:53 AM, joel.green wrote: > I have 4 univariate time series that I believe have correlation between them, > I want to create a VAR model between them all. > > However I have an issue as 3 of them are the same length, however the 4th is > smaller. meaning that i cannot use

Re: [R] sapply and matrix command

2012-08-08 Thread R. Michael Weylandt
On Wed, Aug 8, 2012 at 9:17 AM, alijk1989 [via R] wrote: > > > Hi, > > I have made some progress speeding up my code. This is what I have at the > moment: > > > M1=sum(sapply(1:m, function(k){sum(sapply(1:m,function(j){w[k]*w[j]*LGD^2 > (pmnorm(c(qnorm(Q[k]),qnorm(Q[j])),c(0,0),equicorr(2,rho[k,j]

Re: [R] sweave problem with special danish characters

2012-08-08 Thread Duncan Murdoch
On 08/08/2012 10:58 AM, Jonas Hal wrote: I am using win xp, R 2.15.0 and texi2dvi from the tools package. I'd suggest checking the encoding of your file (if I use latin1, I get an NA like you did). If that's not it, then you should upgrade to the latest release, or to the current patched ver

Re: [R] Save & reload list objects

2012-08-08 Thread Ista Zahn
Hi Rob, On Wed, Aug 8, 2012 at 8:50 AM, robgriffin247 wrote: > So it was simple, or so it seemed. > Now to throw a spanner in the works! > > I got this error when testing it on my more powerful desktop (using one of > my lists put in to a new object) : > > #put list in to new object called "temp"

Re: [R] sweave problem with special danish characters

2012-08-08 Thread Jonas Hal
I am using win xp, R 2.15.0 and texi2dvi from the tools package. Regards Jonas -Oprindelig meddelelse- Fra: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sendt: 8. august 2012 16:43 Til: Jonas Hal Cc: r-help@r-project.org Emne: Re: [R] sweave problem with special danish characters On

Re: [R] dimnames in array

2012-08-08 Thread David Winsemius
On Aug 8, 2012, at 3:19 AM, aleksandr russell wrote: Hello, I'm working with an array; I'm trying to make it so that an array of dim(42,2,2) has names whose length corresponds to that of the array, and am hoping someone with experience with this can see what I'm not doing correctly: data11

Re: [R] sweave problem with special danish characters

2012-08-08 Thread Ista Zahn
Hi Johas, I've run into a similar problem due to Emacs on OSX setting my locale to "C". If you're on Mac or Linux you can try setting Sys.setlocale(category = "LC_ALL", locale = "UTF-8") before calling Sweave() Best, Ista This doesn't æ ø å and pdf document only contains NA On Wed, Aug 8, 20

Re: [R] Overlapping a Plot with Dataframe

2012-08-08 Thread John Kane
John Kane Kingston ON Canada > -Original Message- > From: bioinfo.himan...@gmail.com > Sent: Wed, 8 Aug 2012 02:12:00 -0700 (PDT) > To: r-help@r-project.org > Subject: Re: [R] Overlapping a Plot with Dataframe > > Hello John, > > in simple term, I have a Plot as an Output. > Now I wan

Re: [R] map axis on projected shapefiles

2012-08-08 Thread penguins
Since posting this I've figured out the problem was due to the shapefiles I was reading in. As they were already projected they were in meters, as oppose to decimal degrees. By opening the shapefiles in ArcGIS, reprojecting them to WGS1984 and exporting, I could then reload them in R in decimal deg

Re: [R] sapply and matrix command

2012-08-08 Thread alijk1989 [via R]
Hi, I have made some progress speeding up my code. This is what I have at the moment: M1=sum(sapply(1:m, function(k){sum(sapply(1:m,function(j){w[k]*w[j]*LGD^2 (pmnorm(c(qnorm(Q[k]),qnorm(Q[j])),c(0,0),equicorr(2,rho[k,j]))-Q[k]*Q[j])}))})) I tried setting up a function as so: f1 <- function

  1   2   >