Re: [R] Help with R

2010-10-15 Thread Petr PIKAL
Sometimes such message appears when you try to open .RData file in environment where packages used when the file was created are not installed. Than it is possible just to install necessary packages. Without whole story it is impossible to say what is real cause for that error. Regards Petr

Re: [R] split data with missing data condition

2010-10-15 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.10.2010 15:00:46: you can do the following: mat - cbind(x = runif(15, 50, 70), y = rnorm(15, 2)) mat[sample(15, 2), x] - NA na.x - is.na(mat[, 1]) mat[na.x, ] mat[!na.x, ] Or if you have missing data in several columns and you want select

[R] Odp: Where precision change

2010-10-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.10.2010 11:58:06: Hello everyone. I need some help to understand when number precision in R is set. For this please consider the following example for (i in c(2:length(final))){ sizex - c(sizex,(final[i]-final[i-1],digits=2))) #

Re: [R] is get() really what I want here?

2010-10-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.10.2010 07:58:29: Hi Josh, What I'm really trying to do is to refer to objects whose names I have stored in a vector. This example was arbitrary. I do a lot of looping through files in the working directory, or through objects in the namespace,

Re: [R] remove black square from factor plot

2010-10-21 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 20.10.2010 17:43:27: str(species.factor) Factor w/ 81 levels Acer_platanoides_Bl,..: 12 12 55 55 76 76 52 52 67 67 ... str(minmax) int [1:162] 6163779 7262127 6163779 7422941 6163779 6644861 6163779 6644861 6163779 7262127 ... That

[R] Odp: Efficient nested loops

2010-10-21 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.10.2010 10:40:40: Dear R community, I am working with huge arrays, so I spend a lot of time computing. This is my code: for (x in 1:dim(variable)[1]){ for (y in 1:dim(variable)[2]){ for (z in 1:dim(variable)[3]){

Re: [R] Efficient nested loops

2010-10-21 Thread Petr PIKAL
apply(ar, 4, range) [,1] [,2] [1,]1 61 [2,] 60 120 Regards Petr Thank you! 2010/10/21 Petr PIKAL petr.pi...@precheza.cz Hi r-help-boun...@r-project.org napsal dne 21.10.2010 10:40:40: Dear R community, I am working with huge arrays, so I spend a lot of time

[R] Odp: importing csv gets me all 16,000 columns with NA

2010-10-22 Thread Petr PIKAL
Hi You did not provide much info for help. What is size of imported file (columnsxrows)? r-help-boun...@r-project.org napsal dne 22.10.2010 01:23:03: I'm new to R. I have a mac (OS10.6). I have converted an Excel file to a csv to import into R. I have used many methods to import the file,

[R] Odp: Cbind query

2010-10-22 Thread Petr PIKAL
Hi I am a bit puzzled what you want to do? r-help-boun...@r-project.org napsal dne 22.10.2010 13:06:17: I am new to R and request your kind help. I have a table like the one below, one two 1 apple fruit 2 ball game 3 chair wood 4 wood plain 5

Re: [R] Importing CSV File

2010-10-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.10.2010 00:47:22: sales - read.csv(file=C:/Program Files/R/Test Data/sales.csv, header=TRUE, row.names = Month) ^^^ -Original Message- From: r-help-boun...@r-project.org

[R] Odp: Panel regression

2010-10-26 Thread Petr PIKAL
Hi did you look at help page of lme? r-help-boun...@r-project.org napsal dne 25.10.2010 22:59:40: Hi, I am trying to run a panel regression where I have a matrix of observations and a matrix of independant variables - examples would trying to predict countries's GDP with their data

Re: [R] Conditional looping over a set of variables in R

2010-10-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.10.2010 20:41:55: Adrienne, there's one glitch when I implement your solution below. When the loop encounters a case with no data at all (that is, all 140 item responses are missing), it aborts and prints this error message: ERROR: argument

Re: [R] Help saving multiple graphics

2010-10-26 Thread Petr PIKAL
Hi I agree with this statement especially more complicated problems with longer history of answers could be quite confusing when the history itself is missing in some email. Besides reading help list questions and answers is convenient and quick way to learn R. I do it myself even after

[R] Odp: Mahalanobis distance

2010-10-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.10.2010 10:55:57: Hi everyone, Can you please help me on how to estimate the Mahalanobis distance in a large matrix did you by chance tried ?mahalanobis Regards Petr Thanks Ivone

Re: [R] Mahalanobis distance

2010-10-26 Thread Petr PIKAL
Returns the squared Mahalanobis distance of all rows in x and the vector mu = center with respect to Sigma = cov. We can the mahalanobis distance to apply in clutser analysis so we need the distance between all the elements in the matrix Thanks Ivone -Mensagem original- De: Petr

Re: [R] Increase R precision

2010-10-27 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 27.10.2010 14:21:14: So? Do you imply that I do not need to change the precision.. and if yes how to change the default display settings? (18-46)/(45-93) [1] 0.583 (18-46)/(45-93)*1e12 [1] 5833 So the computation use machine

Re: [R] Plotting 2 Lines on the Same Chart

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.10.2010 20:30:47: Thanks. 1 more question. When I use Plot(series1) lines(series2) 1 use plot(series1) 2 read help page for plot.default if you are plotting simple scatterplot 3 pay attention to xlim and ylim parameters

Re: [R] for loop

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 31.10.2010 09:59:00: Hi Dennis, Thank you for your extensive explanations. Yes, I guess I did not explain what I would like to do. Basically I would like to conduct a linear regression for each of 15 classes. In that case you can also

[R] Odp: connecting points into a smooth curve

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.11.2010 07:18:47: If I have, say, five scatter points and want to connect them together into a smooth curve. As you are not much specific about what you consider smooth curve here are some options use some model ?lm and plot predicted values

Re: [R] Plots inside a Plot

2010-11-01 Thread Petr PIKAL
Hi I remember that I did it also in base graphics but it took me some time to find out how and it was a long time ago so. If I remember it correctly it was some combination of graphic parameters to set user coordinates and do not overwrite the first plot by setting par(new=TRUE) Regards

Re: [R] Odp: connecting points into a smooth curve

2010-11-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.11.2010 13:02:46: To: kai...@berkeley.edu From: petr.pi...@precheza.cz Date: Mon, 1 Nov 2010 11:50:17 +0100 CC: r-help@r-project.org Subject: [R] Odp: connecting points into a smooth

[R] Odp: Sorting data from one column with strings

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 13:28:06: Hello, I have tried to find this out some other way, but unsuccessful I have to try this list. I assume this should be quite simple. I have a dataset with 4 columns, Sample_no, Species, Nitrogen, Carbon in csv format. In

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 14:21:38: Hi David, I am still having troubles with that loop ... This code gives me (kinda) the name of the column/field in a data frame. Filed names are form W1-W10. But there is a space between W and a number -- W 10, and

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
complete more than 3 pages per day. Regards Petr M -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: Thursday, November 04, 2010 3:40 PM To: Matevž Pavlič Cc: r-help@r-project.org Subject: Re: [R] Loop Hi r-help-boun...@r-project.org napsal dne

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
manage it in less then month if you complete more than 3 pages per day. Regards Petr M -Original Message- From: Petr PIKAL [mailto:petr.pi...@precheza.cz] Sent: Thursday, November 04, 2010 3:40 PM To: Matevž Pavlič Cc: r-help@r-project.org Subject: Re: [R] Loop

Re: [R] Creating a list to store output objects from a recursive loop

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 10:26:09: Santosh Srinivas santosh.srini...@gmail.com Odeslal: r-help-boun...@r-project.org 09.11.2010 10:26 Re: [R] Creating a list to store output objects from a recursive loop Figured this out this ways I think outPut -

[R] Odp: Question regarding to replace NA

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 18:33:54: Kate Hsu yhsu.rh...@gmail.com Odeslal: r-help-boun...@r-project.org 09.11.2010 18:33 Komu r-help@r-project.org Kopie Předmět [R] Question regarding to replace NA Dear r-users, Basically, I have a data as

Re: [R] how do i plot this hist?

2010-11-09 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 09.11.2010 20:25:09: casperyc caspe...@hotmail.co.uk Odeslal: r-help-boun...@r-project.org 09.11.2010 20:25 Re: [R] how do i plot this hist? Hi all, Thank you both. The codes work perfectly. I now use barplot(t(x.m)[-1,],

Re: [R] filling a vector with a tapply function applied to another vector

2010-11-12 Thread Petr PIKAL
Hi Use ave instead of tapply. It is designed for such task Regards Petr r-help-boun...@r-project.org napsal dne 12.11.2010 10:49:17: albechan alberto.case...@satt.biz Odeslal: r-help-boun...@r-project.org 12.11.2010 10:49 Re: [R] filling a vector with a tapply function applied to

Re: [R] Do loop

2010-11-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.11.2010 16:17:47: Re: [R] Do loop Gud evening sir ,I want do the cluster analysis algorithm in r software can u guide me sir ??cluster gives you bunch of methods My mail id is :sundars...@gmail.com And I want the brief explanation to

[R] Odp: Sampling problem

2010-11-16 Thread Petr PIKAL
Hi Here is one way (If I understood what you did ask). test-read.table(clipboard, header=T) test SubID CSE1 CSE2 CSE3 CSE4 WSE1 WSE2 WSE3 WSE4 1 165626224 2 264726623 3 355555545 4

[R] Odp: Why some times R-halts?

2010-11-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.11.2010 11:29:28: Alaios ala...@yahoo.com Odeslal: r-help-boun...@r-project.org Hello everyone. I have written a small function that returns a 3*n array where n is typicall between 5-55. I issued in R shweights-shadowing_weights(x,xr)

[R] Odp: Still confused with lapply

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 15:41:08: Hello, I would like to replace a for loop with lapply in order to speed up the treatment of my data (I've read lapply can help to do it). Not exactly. For loop if correctly written can be as quick as lapply. See P.Burns' R

[R] Odp: how to improve this inefficient R code for imputing missing values

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 16:34:04: Without going too deeply to your code, try to check na.locf function from zoo package. I would split your data to list according to study and subject, use na.locf with respect to your miising value types x-c(NA, 1:5) y-rev(x)

Re: [R] Odp: Still confused with lapply

2010-11-19 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 19.11.2010 16:58:01: PtitBleu ptit_b...@yahoo.fr Hello Petr, Your solution works well with my example. But with the function I want to use (which calls another functions), I still have errors. I have to work on it again (but only on monday).

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-23 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.11.2010 19:31:33: I have looked into par documentation, and only setting for size of the plot area was pin. But this setting sets the area as inflexible, that is no R intro manual Chapter 12: Graphical procedures page, 71 A typical figure

[R] Odp: save a regression model that can be used later

2010-11-23 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.11.2010 16:02:20: Hi everyone I have a question about how to save a regression model in R and how to retrieve it for making predictions in a new session. To be more specific, I fitted a multilevel logistic regression model using the lmer

[R] Odp: HELPPPPPP

2010-11-29 Thread Petr PIKAL
Hi What does your teacher says about the procedures you shall use? You shall go through help pages for ?spectrum, ?acf, ?ar and maybe some others. Regards Petr r-help-boun...@r-project.org napsal dne 29.11.2010 11:33:58: please i've a big problem. i've to do a econometric-quantitative

[R] Odp: in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.11.2010 11:48:07: Hello, I am using basic plotting technique to get a graph. but i want to color the points plotted onto the graph depending upon few mathematical logics. values x should be colored blue. values y should be colored green.

Re: [R] in regards of plotting using functions.

2010-11-29 Thread Petr PIKAL
some data from which you wanted to extract first and second column. What about to look into R-intro manual to chapter 2. Regards Petr so how should i embedded the expression within the plot? regards, Pravin On Mon, Nov 29, 2010 at 5:20 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi

Re: [R] Odp: HELPPPPPP

2010-11-30 Thread Petr PIKAL
Hi I am not an expert in time series but I believe you can check easily different values for arima parameters based on ACF and PACF. To give you better help I would need to study some literature and I believe you could more easily do it yourself. Best regards Petr

[R] Odp: Plot a matrix

2010-11-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 30.11.2010 10:52:35: Hi, I have this MATRIX m: key index sensor1.A sensor1.B sensor2.A sensor2.B sensor3.A 2010-10-1 7:32:00 8NA 5NA 2 2010-10-3 4:33:21NA

Re: [R] Odp: Plot a matrix

2010-11-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 30.11.2010 11:52:38: I explain better key index sensor1.A sensor1.B sensor2.A sensor2.B sensor3.A 2010-10-1 7:32:00 8NA 5NA 2 2010-10-3 4:33:21NA 3

[R] Odp: in continuation with the earlier R puzzle

2010-07-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 12.07.2010 16:09:30: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might as well use C or any other language. The reason R is powerful is becasue it can handle large vectors without each

[R] Odp: Barplots

2010-07-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.07.2010 12:18:21: Hi R, I am examining the mean returns 10 days before and 10 days after a event. Now I have several events the corresponding pre and post event 10 day mean returns... something like this Pre_Start

Re: [R] in continuation with the earlier R puzzle

2010-07-13 Thread Petr PIKAL
146 ... Thanks Raghu On Tue, Jul 13, 2010 at 12:01 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 12.07.2010 16:09:30: When I just run a for loop it works. But if I am going to run a for loop every time for large vectors I might

[R] Odp: create variables with indexes

2010-07-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.07.2010 00:44:02: Hi, there: Suppose I want create variables with indexes in their names, e.g., X_1_1, X_1_2, X_1_3, ..., X_1_10, X_2_1, X_2_2, X_2_3, .. X_2_10,..., X_10_1, X_10_2, ... X_10_10. It looks like I need to use 2 indexes I and J

[R] Odp: logical to numeric matrix changing dimensions

2010-07-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.07.2010 07:54:51: example: y=(rbind(c(TRUE,TRUE,TRUE),c(FALSE,FALSE,FALSE))) y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE as.numeric(y) [1] 1 0 1 0 1 0 I am trying to make some important matrixes become nuemric

Re: [R] reverse string

2010-07-14 Thread Petr PIKAL
Hi Quick glance to strsplit help page strReverse - function(x) sapply(lapply(strsplit(x, NULL), rev), paste, collapse=) Regards Petr r-help-boun...@r-project.org napsal dne 14.07.2010 12:36:12: On Wed, 2010-07-14 at 12:13 +0200, Trafim Vanishek wrote: Dear all, Are there any

[R] Odp: count - help

2010-07-14 Thread Petr PIKAL
Hi You does not say much about what you really did. You probably want to consult table or xtabs functions xtabs(~Petal.Width+Species, data=iris) Species Petal.Width setosa versicolor virginica 0.1 5 0 0 0.2 29 0 0

Re: [R] aggregate(...) with multiple functions

2010-07-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.07.2010 05:02:52: On Thu, Jul 15, 2010 at 10:45 PM, Murat Tasan mmu...@gmail.com wrote: hi all - i'm just wondering what sort of code people write to essentially performa an aggregate call, but with different functions being applied to the

[R] Odp: Question from day2 beginner

2010-07-19 Thread Petr PIKAL
Hi I am not an expert in time series modelling but it seems to me that combination ar model and resid extractor function for result of this model does not work as anticipated. Check docs for resid and ar if there is some explanation for this. resid(ar(logrvar, aic=TRUE)) Error in ar.yw(x, aic

[R] Odp: If help

2010-07-21 Thread Petr PIKAL
Hi I would make an interaction of those two vectors. interaction(sample(letters[1:2], 20, replace=T),sample(letters[1:2], 20, replace=T)) [1] a.a a.b b.b b.a b.b b.b a.a a.a b.b b.a a.a a.a b.b b.a a.a a.b b.a a.a b.b [20] a.b Levels: a.a b.a a.b b.b You will get factor and you can change

[R] Odp: R forum

2010-07-22 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.07.2010 05:58:54: Hi, Are there any other forums on R where I can get quick responses to my questions? I've lot of questions as I am learning the basics and exploring advanced computational functions and it is tough to wait for moderator

[R] Odp: legend in R plot

2010-07-22 Thread Petr PIKAL
Hi maybe less number of lines? regards Petr r-help-boun...@r-project.org napsal dne 22.07.2010 06:06:53: Hi all, I am have some difficulty with the legend function. I need to add a legend to describe the different line types in a plot. The legend box is small. It did not include

[R] Odp: Help me with prediction in linear model

2010-07-22 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 21.07.2010 17:46:02: Hi R-community, I have the code as follows,i Fitted model as follows lbeer-log(beer_monthly) t-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ entries not needed t2=t^2

[R] Odp: How to get vector of poitions in a vector ?

2010-07-23 Thread Petr PIKAL
Hi a = c(1,0,0,0,1,0,4,0,0,0) which(a!=0) [1] 1 5 7 Beware of floating point near zero values. Petr r-help-boun...@r-project.org napsal dne 23.07.2010 13:12:44: I have a vector a = c(1,0,0,0,1,0,4,0,0,0) Now I want to get a vector of positions in a vector a where the value is non

[R] Odp: how to calculate the product of every two elements in two vectors

2010-07-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 23.07.2010 17:11:43: Thanks in advance! A=c(1, 2,3) B=c (9, 10, 11, 12) I want to get C=c(1*9, 1*10, 1*11, 1*12, ., 3*9, 3*10, 3*11, 3*12)? C is still a vector with 12 elements Is there a way to do that? Maybe as.vector(t(outer(A,B)))

Re: [R] Odp: Help me with prediction in linear model

2010-07-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.07.2010 11:48:11: Thanks Murphy and pikal, I need another help,for fitting first fourier transformation ,i used following thing .Please advise on this beer_monthl has 400+ records EXample: head(beer_monthly) beer 1 93.2 2 96.0

[R] Odp: Plot of a subset of a data.frame()

2010-07-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.07.2010 13:38:44: Hello, my data.frame is sort of a collection of process values, i.e. huge run-chart. It consists of a time-stamp in the first column (date as string), factors in the following columns (used for subset-filtering), and some

Re: [R] Plot of a subset of a data.frame()

2010-07-27 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 27.07.2010 00:48:52: On Jul 26, 2010, at 10:56 AM, Steffen Uhlig wrote: Dear David, Petr, and Alain, thank you very much for your fast responses. It's a typical handbook-not-read-error at my side. I will dig deeper into the

[R] Odp: Cluster analysis

2010-07-27 Thread Petr PIKAL
Hi you can look at package cluster or maybe mvpart or tree. You could also look to CRAN search facilities where you can find other possible packages. BTW there is no attached sample data, the list has strict policy for allowed attachments. See Posting Guide Regards Petr

[R] Odp: Understanding how R works

2010-07-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.07.2010 10:08:37: Hello everyone. I am more than new into R. Today I have started reading about grf function that is included in geoR package. According the manual (vignette?) grf() generates (unconditional) simulations of Gaussian

[R] Odp: Data frame modification

2010-07-28 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 28.07.2010 11:30:48: Hi I am trying to modify a data frame D with lists x and y in such a way that if a value in x==0 then it should replace that value with the last not zero valuein x. I.e. for loop over i{ if(D$x[i]==0)

Re: [R] Odp: Data frame modification

2010-07-28 Thread Petr PIKAL
not be very fast in R. Regards Siddharth --Original Message-- From: Petr PIKAL To: siddharth.gar...@gmail.com Cc: r-help@r-project.org Subject: Odp: [R] Data frame modification Sent: Jul 28, 2010 6:15 PM Hi r-help-boun...@r-project.org napsal dne 28.07.2010 11:30:48: Hi

[R] Odp: (no subject)

2010-07-29 Thread Petr PIKAL
Hi Your data came rather corrupted but probably you can split your data frame according to var1, select highest rank in var2 and reconstruct data frame from the result see split, lapply, Regards Petr r-help-boun...@r-project.org napsal dne 29.07.2010 15:48:26: Dear R Users! I

Re: [R] Displaying Counts of Unused Factors in Contingency Tables with table()

2010-07-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.07.2010 16:03:30: Dennis, Thank you for your response. For clarification, I was not expecting table() to divinely figure out the intent that I was making two levels out of one (given my character vectors). Since table() is a generic

[R] Odp: Fwd: duplicates

2010-07-29 Thread Petr PIKAL
Hi rather complicated one liner assuming your data frame has name test do.call(rbind,lapply(split(test,test$var1), function(x) x[which.max(x[,var2]),])) Here it is in 3 lines test.s - split(test,test$var1) # splits data frame result - lapply(test.s, function(x) x[which.max(x[,var2]),]) #

[R] Odp: locator function and connecting segment

2010-07-29 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.07.2010 18:50:20: Dear R People: I'm using the locator() function on a chart and I select two values. Is there a way already in place to connect the two values with a line segment, please? I did this some time ago and put it to simple

Re: [R] Help with scatterplots in R

2010-07-30 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.07.2010 18:13:57: Hi John, yes, you are right. Here is what I have done: plot(DateJonEnd1, End1Jon, main=Weekly Training at Endurance 1, xlim=c(13700,14750), xlab=Date, ylim=c(0,350), ylab=Volume at Endurance 1, type=b, las=1)

[R] Odp: Date and Time Formatting

2010-08-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.08.2010 10:21:25: Hi , I have a huge data set (192840 x 5) and would like to convert the date and time format. The data looks something like below : 0 03/01/1983 01:00 -0.10 359.0 0 03/01/1983 02:00 -0.10 359.0 0

[R] Odp: QQ-plot – Axes

2010-08-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.08.2010 09:40:51: I would like to change the position of the major tick marks in my qq-plot? Right now the ticks are set at 5.5, 6.0, 6.5 and 7.0. I would like them to be at 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.8 and 7.0. So I

[R] Odp: The condition has length 1 and only the first element will be used

2010-08-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.08.2010 13:03:33: Hi All, I'm trying to run the following script in R, but I'm getting a warning saying: Warning message: In if (z 0) { : the condition has length 1 and only the first element will be used As you can see, I'm sending

Re: [R] The condition has length 1 and only the first element will be used

2010-08-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.08.2010 13:17:16: Ok thanks, but I have found the solution: ifelse. Here goes a working version of the code: mod = function(x) { ifelse(x 0,x*(-1),x) } But before you reinvent wheel try to look if there is not available function already

Re: [R] how to do a IF ELSE in a matrix format

2010-08-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.08.2010 19:02:41: question again. here is part of my original code for my research question. originally I used a loop with matrix form to do the work and it works (though looks ugly). I have tried the methods mentioned in the above posts

[R] Odp: merge two data frames

2010-08-04 Thread Petr PIKAL
Hi you tried OK result - merge(zz, av, by=DESCRIPTION, all=TRUE) and as you did not specify what to do when one value is NA here is one possible solution rowSums(cbind(result$PL.x, result$PL.y), na.rm=T) Regards Petr r-help-boun...@r-project.org napsal dne 04.08.2010 11:52:00: Dear list,

Re: [R] applying strsplit to a whole column

2010-08-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.08.2010 21:03:10: I am sorry, someone said that strsplit automatically works on a column. How exactly does it work? For example, if I want to grab just the first (or the second) part of the string in nam1 that should be split based on ..

[R] Odp: Error: cannot allocate vector of size xxx Mb

2010-08-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.08.2010 09:53:21: I am dealing with very large data frames, artificially created with the following code, that are combined using rbind. a - rnorm(500) b - rnorm(500) c - rnorm(500) d - rnorm(500) first - data.frame(one=a,

Re: [R] Error: cannot allocate vector of size xxx Mb

2010-08-05 Thread Petr PIKAL
, 2010 at 4:44 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 05.08.2010 09:53:21: I am dealing with very large data frames, artificially created with the following code, that are combined using rbind. a - rnorm(500) b - rnorm(500

[R] Odp: For Loop

2010-08-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.08.2010 10:47:03: I have some code that is working. The code calculates the error from the real vale when it does a run. The error in metres in called errorxy I want to do 10 runs of the code and everytime it does a run I want to an

[R] Odp: m-estimators

2010-08-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.08.2010 09:10:44: Dear colleagues can somebody help me by showing how we can compute m-estimators in R? Open your favourite browser. Open CRAN page Go to search Input m-estimators as search term. You will got about 3500 hits, definitely some

[R] Odp: Pausing script to allow user input from keyboard.

2010-08-06 Thread Petr PIKAL
Hi Some time ago somebody advised me to use cat(\n,Enter filename,\n) # prompt x=scan(n=1) # read 1 line from console than use x in further code Regards Petr r-help-boun...@r-project.org napsal dne 06.08.2010 15:52:17: Hi all, I have written a simple R script to help me analyze a large

Re: [R] Odp: Pausing script to allow user input from keyboard.

2010-08-09 Thread Petr PIKAL
Hi you are right. From ?scan default value for imput value is double, so you need to specify that it shall be character. I just showed possible solution not a solution which can be used in all imaginable cases. Regards Petr r-help-boun...@r-project.org napsal dne 07.08.2010 05:20:56: I'm

[R] Odp: Running something without a loop when the result from the previous iteration is require for the current iteration

2010-08-12 Thread Petr PIKAL
Hi without toy example it is rather complicated to check your function. So only few remarks: Instead of generating 1 random number inside a loop generate whole vector of random numbers outside a loop and choose a number Do not mix ifelse with if. ifelse is intended to work with whole vector.

Re: [R] Running something without a loop when the result from the previous iteration is require for the current iteration

2010-08-13 Thread Petr PIKAL
won't get specific answer. Instead of trying to explain it by elaborated text use dput for exporting objects needed for computation and if possible also the outcome. Regards Petr On Thu, Aug 12, 2010 at 3:21 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi without toy example

[R] Odp: help

2010-08-13 Thread Petr PIKAL
Hi write.table(tab, clipboard, sep = \t, row.names = FALSE) or write.table(tab, somefile.xls, sep = \t, row.names = FALSE) Regards Petr r-help-boun...@r-project.org napsal dne 13.08.2010 01:47:40: I need a code to export my output to excel 2007.I am dealing with observations of

[R] Odp: loop for inserting rows in a matrix

2010-08-13 Thread Petr PIKAL
Hi First of all, use data frame instead of matrix. Matrix is vector with dimensions and hence it can not have mixed values (numeric, character, date..). So let's ASDF is your whole data frame

[R] Odp: Fw: Error in rowSums REPOST

2010-08-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.08.2010 13:50:20: For the query below I have also included the follwing information. Thanks for your replies str(FeaturePresenceMatrix) chr [1:65530, 1:40] 0 0 0 0 1 0 0 0 0 ... - attr(*, dimnames)=List of 2 ..$ : chr [1:65530] 4 5 6 7

Re: [R] Fatal Error

2010-08-23 Thread Petr PIKAL
Hi Another possibility could be that .RData was saved when some packages were used and are not installed in this R version (I often percieve it when I migrate among different computers). If the complete error message suggests it you can install that package and you may open your .RData again

[R] Odp: easiest way to write an R dataframe to excel?

2010-08-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 23.08.2010 21:50:01: I am using R 2.11.1 in a Microsoft Windows 7 environment. I tried using WriteXLS, but get the message In system(cmd) : perl not found What is the easiest way to write an R dataframe to Excel? (I am familiar with

[R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hi without other details it is probably impossible to give you any reasonable advice. Do you have your data already in R? What is their form? Are they in 2 columns in data frame? How did you get them paired? So without some more information probably nobody will invest his time as it seems no

Re: [R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hm r-help-boun...@r-project.org napsal dne 25.08.2010 09:43:26: Dear Mr Petr Pikal I am extremely sorry for the manner I have raised the query. Actually that was my first post to this R forum and in fact even I was also bit confused while drafting the query, for which I really owe sorry

Re: [R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hi well, I will add some explanation r-help-boun...@r-project.org napsal dne 25.08.2010 11:24:38: Dear Mr Petr PIKAL After reading the R code provided by you, I realized that I would have never figured out how this could have been done. I am going to re-read again and again your code

[R] ggplot inside cycle

2010-08-26 Thread Petr PIKAL
Dear all I want to save several ggplots in one pdf document. I tried this for (i in names(iris)[2:4]) { p-ggplot(iris, aes(x=Sepal.Length, y=iris[,i], colour=Species)) p+geom_point(aes(size=3)) } with different variations of y input but was not successful. In past I used qplot in similar

Re: [R] ggplot inside cycle

2010-08-26 Thread Petr PIKAL
/2010 06:08 AM, Petr PIKAL wrote: Dear all I want to save several ggplots in one pdf document. I tried this for (i in names(iris)[2:4]) { p-ggplot(iris, aes(x=Sepal.Length, y=iris[,i], colour=Species)) p+geom_point(aes(size=3)) } with different variations of y input

[R] Odp: Sorting groups in bwplot chart

2010-08-27 Thread Petr PIKAL
Hi make Month factor, sort its levels and do bwplot as you did ?factor ?levels Regards Petr r-help-boun...@r-project.org napsal dne 27.08.2010 15:03:06: Hi all, I am just curious how to sort the groups in a categorical box plot chart bwplot here is the example:

Re: [R] online documentation only?

2010-08-31 Thread Petr PIKAL
Hi You shall also check setting of your browser, especially proxy. Sometimes help system interacts with particular setting and produce errors or does not start at all. Regards Petr r-help-boun...@r-project.org napsal dne 30.08.2010 22:16:17: Thanks for the replies. I tried help.start()

Re: [R] Failure to aggregate

2010-09-09 Thread Petr PIKAL
Hi you has to provide some more info about x e.g. str(x) x-data.frame(price=1, h=Sys.time()) r-help-boun...@r-project.org napsal dne 08.09.2010 10:18:52: Mnay thanks fr suggestions. I am afraid this is one tough daatframe... t = sqldf(select h, count(*) from x group by h) Error in

Re: [R] URL error when trying to use help function in R [Sec: UNOFFICIAL]

2010-09-10 Thread Petr PIKAL
Hi I had similar issue and it was solved by setting proxy in browser preferences to do not use proxy server for 127.0.0.1 and it helped. Regards Petr r-help-boun...@r-project.org napsal dne 10.09.2010 08:18:53: On 09/10/2010 01:03 AM, David Winsemius wrote: On Sep 9, 2010, at 6:34

[R] Odp: Data.frames : difference between x$a and x[, a] ? - How set new values on x$a with a as variable ?

2010-09-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.09.2010 10:05:37: Hi, I got two questions : 1st Question          a=S          b=data.frame(S=3)          do.call(`-`,list(do.call(`$`,list(b,S)),5)) = How can I put new values on S column having the

  1   2   3   4   5   6   7   8   9   10   >