Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Duncan Mackay
Hi Marna

 

These are a few suggestions for EDA of your data

 

Firstly check it – it is laborious work but it needs to be done – use a proper 
database if R is not suitable (memory,time)

 

dat <- read.csv("G:/1/example_subsetdata.csv")

dat <- subset(dat, !is.na(depth))

 

apply(dat,2,range,na.rm=T)

table(cut(dat$depth, breaks = seq(496.5, 498.5, 0.25), include.lowest = TRUE, 
labels = F)) # needs more groups to even out numbers 

# use hand drafted breaks

table(dat$Y)

 

dat$ldepth <- cut(dat$depth, breaks = seq(496.5, 498.5, 0.25), include.lowest = 
TRUE, labels = F)

xyplot(Y ~ X|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = TRUE)

xyplot(flow ~ X|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = 
TRUE, col =1)

xyplot(flow ~ Y|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = 
TRUE, col =1)

 

I have made pch = ‘.’ so that  points are not overtopping. increase by by units 
ie cex = 2 , cex =3 if you want to make them larger

 

Have a look a lattice::par.settings  and names(trellis.par.get()) these will 
make things easier if you you are using panel functions.

 

I did not go further but the next step in this would be lattice 3d plots 
contourplot wireframe etc.
You will get more information in working with the full dataset
 
I have not really gone into spatials  but you should look at the task view on 
spatial analysis.
and the spatial SIG
 
How you proceed will be partly determined by your future requirements of which 
I am not qualified.
 
Regards
 
Duncan

 

 

 

From: Marna Wagley [mailto:marna.wag...@gmail.com] 
Sent: Friday, 14 October 2016 03:13
To: Duncan Mackay
Subject: Re: [R] can we visualize water flows with 3d in R?

 

Hi Duncan, 

Thank you very much for the message. Indeed I do have a very big data set with 
a grid size of 10cm * 10 cm. Every 10 cm*10cm grid has the value of X,Y, depth 
and flow measurement. I have attached a subset of the data. 

Thanks 

 

 

On Wed, Oct 12, 2016 at 11:05 PM, Duncan Mackay  wrote:

Hi

With a small data set 3D is not really an option;  reduce the number of
dimensions-- 2D conditional

library(lattice)
xyplot(flow ~ depth|factor(long), dat1, groups = lat, type = c("p","r"), pch
= 16)

I had started with lat and long reversed doing EDA gave the above
? latitude effect

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mac...@northnet.com.au

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marna Wagley
Sent: Wednesday, 12 October 2016 19:49
To: r-help mailing list
Subject: [R] can we visualize water flows with 3d in R?

Hi R Users,
Is it possible to visualize river flow in  3D (latitude, longitude with
respect to depth)?
The example of my data looks like. Any suggestions?

> dat1
long lat depth flow
1 1015.9 857  1.00 1.50
2 1015.9 857  1.25 1.23
3 1015.9 857  0.50 2.00
4 1015.9 858  0.10 1.95
5 1015.9 858  0.20 1.50
6 1025.0 858  0.30 1.20
7 1025.0 858  0.40 0.50
8 1025.0 858  0.35 0.70
9 1025.0 858  0.24 1.20

Thanks for your help.
thanks

[[alternative HTML version deleted]]


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread Andreas Nord

Dear list,

Apologies for a likely naive question.


I am trying to create a discriminating dummy variable using 'ifelse' based on 
conditions in two variables.


Specifically, I want to assign levels in a new factor as '0' or '1' based on a 
user-defined cut off. I.e. something similar to:

  >data1<-data.frame(molecule=runif(30,min=0,max=1e3))

>data1$newcol<-ifelse(data1$molecule>2*sd(data1$molecule),1,0)


Which is all straightforward.


But how do I go on to assign values in variable 'molecule'based on the same cut 
off, but separately for each level of a second variable, in this case the 
factor 'fruit' with three levels. That is, how do I derive fruit-specific 
cut-offs using a data frame with the general structure of that below?

>data2<-data.frame(molecule=runif(30,min=0,max=1e3),fruit=factor(rep(c('apple','pear','orange'),10)))


Many thanks in advance!



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-14 Thread Manohar Reddy
Hi,

​ Is there any possibility that we can capture cpu usage ,memory usage and
disks info using R language on *windows family OS* ?



  I would like to see data that’s looks like
​a​
 below



   Cpu usage : 70 %

   Memory usage  : 80 %

   Disks: C drive – 40 % full,D dive – 60 %,full E drive – 30 % full


​   for more info please find the attachement.​


 Thanks in Advance ,Manu.​
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Marna Wagley
Thanks for everyone for your suggestions. I am trying to use the techniques
that you suggested and I will update you its outcome so that it might be
useful to other too.
Thanks,


On Thu, Oct 13, 2016 at 2:10 PM, Duncan Murdoch 
wrote:

> On 13/10/2016 11:14 AM, Thomas Adams wrote:
>
>> Duncan,
>>
>> Oh, to be sure, with a fair amount of work, you're probably correct that
>> one could mash up something. Here are some examples:
>>
>> http://www.illinoisfloods.org/documents/2013_IAFSM_Conferenc
>> e/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
>> <--- lots of graphics
>>
>> http://rivergis.com/
>>
>> also...
>> http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/
>> Tutorials/Geo_RAS/georastutorial.pdf
>> -- pages 35->
>> https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
>> (figures 4-17, 4-18), p. 147
>>
>
> Thanks.  I guess it's up to Marna to say whether any of those figures are
> like what she wants to produce from her data.
>
> Duncan Murdoch
>
>
>> Best,
>> Tom
>>
>> On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch
>> > wrote:
>>
>> On 13/10/2016 8:35 AM, Thomas Adams wrote:
>>
>> All,
>>
>> Very respectfully, there are no R packages that can do what
>> Marna desires.
>>
>>
>> I would guess that's not literally true, in that there are several
>> graphics packages that are very flexible.   You could well be right
>> that there are none that are designed specifically for this purpose,
>> so she's probably going to have to do some work to get what she wants.
>>
>> His/Her data, undoubtably, comes from a 1-D hydraulic model
>> simulation -- where output is generated at channel
>> cross-sections -- representing the sloping water surface
>> elevation of the centerline of flow in a stream or river. With
>> mapping software for such problems, the assumption is made that
>> the water surface intersects the topography (within or beyond
>> the stream channel) perpendicular to the direction of flow.
>> Hydrodynamically, this is generally not correct, but it's a
>> reasonable approximation. To do this, typically, the topography
>> -- in the from of a raster digital elevation model (DEM) -- is
>> converted to a triangular irregular network (TIN) to facilitate
>> the creation of a smoother line of intersection between the
>> water surface and topography. Because, the water surface slopes
>> in a downstream direction, contour lines are crossed. Hydraulic
>> modeling software usually is accompanied by this mapping
>> capability, such as with HEC-RAS with RAS-Mapper, developed by
>> the US Army Corps of Engineers, or with HEC-GeoRAS, which
>> requires ESRI ARC GIS; but, there is also a QGIS plugin module
>> that can do this, I believe. These software packages do
>> facilitate representing the flow in 3D.
>>
>>
>> Do you know any sample figures online that would show the type of
>> graph that is usually used here?
>>
>> Duncan Murdoch
>>
>>
>> Tom
>>
>>
>> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
>> 
>> >>
>> wrote:
>>
>>
>> > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>> 
>> >
>> >> wrote:
>> >
>> > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>> >> Hi R Users,
>> >> Is it possible to visualize river flow in 3D (latitude,
>> longitude with
>> >> respect to depth)?
>> >> The example of my data looks like. Any suggestions?
>> >>
>> >>> dat1
>> >>long lat depth flow
>> >> 1 1015.9 857  1.00 1.50
>> >> 2 1015.9 857  1.25 1.23
>> >> 3 1015.9 857  0.50 2.00
>> >> 4 1015.9 858  0.10 1.95
>> >> 5 1015.9 858  0.20 1.50
>> >> 6 1025.0 858  0.30 1.20
>> >> 7 1025.0 858  0.40 0.50
>> >> 8 1025.0 858  0.35 0.70
>> >> 9 1025.0 858  0.24 1.20
>> >>
>> >> Thanks for your help.
>> >
>> > It may be, but it's hard to give a nice looking graphic of
>> that
>> small dataset.  You could try the rgl package and use plot3d
>> to
>> show spheres with radius depending on the flow rate, for
>> example
>> >
>> > plot3d(cbind(long, lat, depth), type="s", col="blue",
>> radius=flow/5)
>>
>> A complementary option is to install the plot3D package which

[R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread Vijayakumar, Sowmya
Hi R-Help team,


Greeting from AstraZeneca India!!



We are currently using *R 3.1.1* in Windows machine for one of our application. 
We have a plan to upgrade the application. Please let us know the steps to 
download the R which is compatible with *Oracle Enterprise Linux (OEL) v6.5.*

Thanks,
Sowmya



Confidentiality Notice: This message is private and may ...{{dropped:10}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread PIKAL Petr
Hi

Another option is to use ave

1*(data2$molecule>ave(data2$molecule, data2$fruit, FUN=function(x) 2*sd(x)))

Cheers
Petr


> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon
> Sent: Friday, October 14, 2016 10:51 AM
> To: Andreas Nord 
> Cc: r-help@r-project.org
> Subject: Re: [R] ifelse for creating discriminating variable based on two
> conditions
>
> Hi Andreas,
> Try this:
>
> fruit_2sds<-by(data2$molecule,data2$fruit,sd)*2
> data2$newcol<-ifelse(data2$molecule>fruit_2sds[data2$fruit],1,0)
>
> or even just:
>
> data$newcol<-as.numeric(data2$molecule>fruit_2sds[data2$fruit])
>
> Jim
>
>
> On Fri, Oct 14, 2016 at 5:17 PM, Andreas Nord 
> wrote:
> >
> > Dear list,
> >
> > Apologies for a likely naive question.
> >
> >
> > I am trying to create a discriminating dummy variable using 'ifelse' based 
> > on
> conditions in two variables.
> >
> >
> > Specifically, I want to assign levels in a new factor as '0' or '1' based 
> > on a
> user-defined cut off. I.e. something similar to:
> >
> >   >data1<-data.frame(molecule=runif(30,min=0,max=1e3))
> >
> >>data1$newcol<-ifelse(data1$molecule>2*sd(data1$molecule),1,0)
> >
> >
> > Which is all straightforward.
> >
> >
> > But how do I go on to assign values in variable 'molecule'based on the same
> cut off, but separately for each level of a second variable, in this case the
> factor 'fruit' with three levels. That is, how do I derive fruit-specific 
> cut-offs
> using a data frame with the general structure of that below?
> >
> >>data2<-
> data.frame(molecule=runif(30,min=0,max=1e3),fruit=factor(rep(c(
> >>'apple','pear','orange'),10)))
> >
> >
> > Many thanks in advance!
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender 

[R] Getting cited references and times cited from DOI for analysis in R?

2016-10-14 Thread Rainer M Krug
Hi

This sounds off topic, but as I want to analyse the data in R and the R
community is extremely knowledgeable in many respects.

So here I go:

I have "inherited" a literature list for further analysis containing
more than 5000 references. What I would like to do is construct citation
trees (who has cited whom) and analyze the times each reference has been
cited. Noe the literature list does unfortunately not contain the
references cited in each reference.

I have seen the "scholary" paper which allows me to get information on
an author - but is there something similar for getting a list of the
cited papers and the count of how often the paper has been cited? 

I have access to web of science, which can provide this information, but
can I somehow do this in a scripted R way as I want to analyse the data
in R afterwards?

Thanks,

Rainer

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] read.epiinfo() returns wrong data when reading epiinfo files with \032 at the end

2016-10-14 Thread Artur Neumann
Sorry to send this report by email, but I cannot see a way how to create
a login on https://bugs.r-project.org

Problem-Description:
I'm using the foreign package to read EPIINFO 6 files. (.REC)
All my .REC files end with a single character after the last line break.
Octal: 032 / Hex: 1A
The output data frame of read.epiinfo() has an extra line that has the
content of the first line but with shifted data and \032 added at the
beginning

Expected result:
the last line (content: " \032") would be ignored

How to reproduce:

Read an epiinfo 6 file with Octal: 032 / Hex: 1A as the only character
in the last line

--
earData2<-read.epiinfo("EAR35.REC")
Warnmeldungen:
1: In read.epiinfo("EAR35.REC") : wrong number of records
2: In matrix(datalines, nrow = multiline) :
  Datenlänge [3226] ist kein Teiler oder Vielfaches der Anzahl der
Zeilen [3]
--

Now the first data line is added at the end again and the data is partly
shifted


earData2[1,]
 FIRSTNAME SURNAME AGEYEARS MTHS SEX  VDC SYRINGED
1 OM LAL   SUBEDI41   NA   M BUR FALSE
  AUDIO FIRSTEARMA OTHEREARMA SNHLDETAIL CHLOTOSCLE DUMBYN CSOMDETAIL
1  TRUECSOCSONA NA TT
  OTHERDIAGN OPERATIONY GROMMETS HEARINGAID MYRINGTYMP EARDROPS
1  TRUE  2   NA
  MASTOIDECT ORALANTIBI STAPEDECTO OTHERTR OTHEROP TREATMENTD
1NA NA   

earData2[nrow(earData2),]
   FIRSTNAME SURNAME AGEYEARS MTHS  SEX  VDC
1076 \032OM LAL   SUBEDI41  MBUR
 SYRINGED AUDIO FIRSTEARMA OTHEREARMA SNHLDETAIL CHLOTOSCLE DUMBYN
1076   NA FALSEYCSOCSO   NA NA
 CSOMDETAIL
1076  T
OTHERDIAGN
1076 T
 OPERATIONY GROMMETS HEARINGAID MYRINGTYMP EARDROPS MASTOIDECT
1076 NAY NA   
 ORALANTIBI STAPEDECTO OTHERTR OTHEROP TREATMENTD
1076 NA NA  !



Debugging:
The problem is in
https://github.com/cran/foreign/blob/master/R/read.epiinfo.R#L74

after row 66 datalines look like that:

.
[2737] "GOBINDA RAJ34  MTIJ NNO.EO.E
 !"
[2738] "  N   Y
 !"
[2739] " BETNESOL !"

[2740] "AMARRAJ40  MKAL NNMYRNOR
 !"
[2741] "  N   Y
 !"
[2742] " GENT HC  !"

[2743] "\032"

Warning is shown in line 73


after line 74:

datalines[,1]
[1] "HARI SUNDAR SHRESTHA   37  MDIP NNNORNOR
EPISTAXIS  !"
[2] "  N
  !"
[3] " NEOSPORIN!"

and

datalines[,915]
[1] "\032"

[2] "HARI SUNDAR SHRESTHA   37  MDIP NNNORNOR
EPISTAXIS  !"
[3] "

this does result in a wrong result.
I propose to ignore a last line that only contains "\032"
Maybe something like this in line 67:

if(identical(tail(datalines, n=1),c("\032"))) {
length(datalines)<-(length(datalines)-1) }

--
Package: foreign
 Version: 0.8-67
 Maintainer: R Core Team 
 Built: R 3.3.1; x86_64-pc-linux-gnu; 2016-09-26 12:57:55 UTC; unix

R Version:
 platform = x86_64-pc-linux-gnu
 arch = x86_64
 os = linux-gnu
 system = x86_64, linux-gnu
 status =
 major = 3
 minor = 3.1
 year = 2016
 month = 06
 day = 21
 svn rev = 70800
 language = R
 version.string = R version 3.3.1 (2016-06-21)
 nickname = Bug in Your Hair

Locale:
 
LC_CTYPE=de_DE.utf8;LC_NUMERIC=C;LC_TIME=de_DE.utf8;LC_COLLATE=de_DE.utf8;LC_MONETARY=de_DE.utf8;LC_MESSAGES=de_DE.utf8;LC_PAPER=de_DE.utf8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=de_DE.utf8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices,
 package:utils, package:datasets, package:methods, Autoloads,
 package:base


This package has a bug submission web page, which we will now attempt
to open.  The information above may be useful in your report. If the web
page doesn't work, you should send email to the maintainer,
R Core Team .


Mit freundlichen Grüßen
Artur Neumann

-- 
www.individual-it-services.de
EDV Lösungen, die auf Ihre Wünsche und Anforderungen angepasst sind.
Blog: http://individualit.wordpress.com/
Aktuelle Infos: http://twitter.com/INDIVIDUALIT

Bankverbindung:
KtoNr:46201786
BLZ: 47650130
Sparkasse Detmold

Steuernummer:   313/5277/1775

__

Re: [R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread Jim Lemon
Hi Andreas,
Try this:

fruit_2sds<-by(data2$molecule,data2$fruit,sd)*2
data2$newcol<-ifelse(data2$molecule>fruit_2sds[data2$fruit],1,0)

or even just:

data$newcol<-as.numeric(data2$molecule>fruit_2sds[data2$fruit])

Jim


On Fri, Oct 14, 2016 at 5:17 PM, Andreas Nord  wrote:
>
> Dear list,
>
> Apologies for a likely naive question.
>
>
> I am trying to create a discriminating dummy variable using 'ifelse' based on 
> conditions in two variables.
>
>
> Specifically, I want to assign levels in a new factor as '0' or '1' based on 
> a user-defined cut off. I.e. something similar to:
>
>   >data1<-data.frame(molecule=runif(30,min=0,max=1e3))
>
>>data1$newcol<-ifelse(data1$molecule>2*sd(data1$molecule),1,0)
>
>
> Which is all straightforward.
>
>
> But how do I go on to assign values in variable 'molecule'based on the same 
> cut off, but separately for each level of a second variable, in this case the 
> factor 'fruit' with three levels. That is, how do I derive fruit-specific 
> cut-offs using a data frame with the general structure of that below?
>
>>data2<-data.frame(molecule=runif(30,min=0,max=1e3),fruit=factor(rep(c('apple','pear','orange'),10)))
>
>
> Many thanks in advance!
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Is there a way to prevent Rscript from opening help page when given an error

2016-10-14 Thread Tan, Johnny
I posted this on stackoverflow but there hasn't been any replies, does anyone 
know a solution for this?





I am running a script via command line using Rscript nameOfmyRscript. I notice 
that when there is an error, my browser would open with the help page. Now my 
script contained repeated errors of the same type so my browser had 10 tabs of 
the same help page. Is there a command or way to prevent R from opening up 
these pages? I know that you can suppress all warnings by doing option(warn=-1) 
and that you can use sink() to write errors and warnings to file. I currently 
have the errors and warnings written to separate files, but the help page keeps 
opening. I would prefer to not have any help pages open at all.

The following error would open the mean.html help page

Error in mean.default(workshop) :

(converted from warning) argument is not numeric or logical: returning NA


Thanks
-

The information contained in this e-mail message, and any attachment thereto, 
is confidential and may not be disclosed without our express permission. If you 
are not the intended recipient or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
you have received this message in error and that any review, dissemination, 
distribution or copying of this message, or any attachment thereto, in whole or 
in part, is strictly prohibited. If you have received this message in error, 
please immediately notify us by telephone, fax or e-mail and delete the message 
and all of its attachments. Thank you. Every effort is made to keep our network 
free from viruses. You should, however, review this e-mail message, as well as 
any attachment thereto, for viruses. We take no responsibility and have no 
liability for any computer virus which may be transferred via this e-mail 
message.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Hutchinson, David (EC)
Karline, 

You may want to explore Green Kenue 
(http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/green_kenue_index.html). It 
is freely available (download through an email request) and supports 3D data 
visualization and I believe it now has a python API to allow some automation.
 
Unfortunately it is only supported for Windows-based OS.

Dave

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch
Sent: October 13, 2016 2:11 PM
To: Thomas Adams
Cc: r-help mailing list; Karline Soetaert
Subject: Re: [R] can we visualize water flows with 3d in R?

On 13/10/2016 11:14 AM, Thomas Adams wrote:
> Duncan,
>
> Oh, to be sure, with a fair amount of work, you're probably correct 
> that one could mash up something. Here are some examples:
>
> http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conferen
> ce_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
> <--- lots of graphics
>
> http://rivergis.com/
>
> also...
> http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/Tutorials/Geo_R
> AS/georastutorial.pdf
> -- pages 35->
> https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70-> 
> (figures 4-17, 4-18), p. 147

Thanks.  I guess it's up to Marna to say whether any of those figures are like 
what she wants to produce from her data.

Duncan Murdoch

>
> Best,
> Tom
>
> On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch 
> > wrote:
>
> On 13/10/2016 8:35 AM, Thomas Adams wrote:
>
> All,
>
> Very respectfully, there are no R packages that can do what
> Marna desires.
>
>
> I would guess that's not literally true, in that there are several
> graphics packages that are very flexible.   You could well be right
> that there are none that are designed specifically for this purpose,
> so she's probably going to have to do some work to get what she wants.
>
> His/Her data, undoubtably, comes from a 1-D hydraulic model
> simulation -- where output is generated at channel
> cross-sections -- representing the sloping water surface
> elevation of the centerline of flow in a stream or river. With
> mapping software for such problems, the assumption is made that
> the water surface intersects the topography (within or beyond
> the stream channel) perpendicular to the direction of flow.
> Hydrodynamically, this is generally not correct, but it's a
> reasonable approximation. To do this, typically, the topography
> -- in the from of a raster digital elevation model (DEM) -- is
> converted to a triangular irregular network (TIN) to facilitate
> the creation of a smoother line of intersection between the
> water surface and topography. Because, the water surface slopes
> in a downstream direction, contour lines are crossed. Hydraulic
> modeling software usually is accompanied by this mapping
> capability, such as with HEC-RAS with RAS-Mapper, developed by
> the US Army Corps of Engineers, or with HEC-GeoRAS, which
> requires ESRI ARC GIS; but, there is also a QGIS plugin module
> that can do this, I believe. These software packages do
> facilitate representing the flow in 3D.
>
>
> Do you know any sample figures online that would show the type of
> graph that is usually used here?
>
> Duncan Murdoch
>
>
> Tom
>
>
> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
> 
> >>
> wrote:
>
>
> > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
> 
>  >> wrote:
> >
> > On 12/10/2016 4:49 AM, Marna Wagley wrote:
> >> Hi R Users,
> >> Is it possible to visualize river flow in 3D (latitude,
> longitude with
> >> respect to depth)?
> >> The example of my data looks like. Any suggestions?
> >>
> >>> dat1
> >>long lat depth flow
> >> 1 1015.9 857  1.00 1.50
> >> 2 1015.9 857  1.25 1.23
> >> 3 1015.9 857  0.50 2.00
> >> 4 1015.9 858  0.10 1.95
> >> 5 1015.9 858  0.20 1.50
> >> 6 1025.0 858  0.30 1.20
> >> 7 1025.0 858  0.40 0.50
> >> 8 1025.0 858  0.35 0.70
> >> 9 1025.0 858  0.24 1.20
> >>
> >> Thanks for your help.
> >
> > It may be, but it's hard to give a nice looking graphic of
> that
> small dataset.  You could try the rgl package and use plot3d to
> show spheres with radius depending on 

Re: [R] Subclass Prediction

2016-10-14 Thread PIKAL Petr
Hi

?factor
?expand.grid

something like

ff<-factor(sample(1:3, 10, replace=T))
factor(ff, labels=c("male", "female", "mixed"))
 [1] male   female mixed  mixed  female female female female mixed  male
Levels: male female mixed

Cheers
Petr

>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of TJUN KIAT
> TEO
> Sent: Friday, October 14, 2016 6:07 AM
> To: r-help@r-project.org
> Subject: [R] Subclass Prediction
>
> I am trying to work clustering problem where I actually know the sublcass.
> For example
>
>
> Suppose I am trying to predict cluster patients a group of people into male
> and female where I actually know the label male and female but I take it I
> don't know
>
>
> Suppose my clustering method produces subclasses label 1 and 2. Is there a
> quick method of how to assign which labels 1 and 2 to male or female to
> maximize my prediction accuracy? Obvious in this case since there are only
> two cases it is trivial but when the number of subclasses gets big it, trying 
> all
> the possible combinations can be very time consuming.
>
>
> Regards
>
>
> Tjun Kiat
>
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] pheatmap - clustering on some columns only

2016-10-14 Thread Adrian Johnson
Dear group,
I have a matrix (300 rows X 475columns).
The data is divided into many classes.
For examples:
475 columns are split into 3 categories - A, B and C

Is it possible to force clustering of columns in A followed by B and C.
I do not want to cluster whole matrix. I want to cluster by 3 categories.

Thanks in advance.

Adrian

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread David Winsemius

> On Oct 14, 2016, at 12:03 PM, Rich Shepard  wrote:
> 
>  I've read chapters 7 and 8 in the Lattice book and do not see how to thin
> labels on the x and y axes of an xyplot(), and how to rotate the dates on
> the x axis for easier reading (rot did not do the job for me.)
> 
>  The data (as raindata.dat) and the existing plot (as precip.pdf) are
> attached.

The structure( .. ) call would need to be sourced:

> rain <- source("~/raindata.dat")
> str(rain)
List of 2
 $ value  :'data.frame':341 obs. of  3 variables:
  ..$ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1 ...
  ..$ date   : Factor w/ 62 levels "2013-12-01","2013-12-02",..: 32 33 34 35 36 
37 38 39 40 41 ...
  ..$ amount : Factor w/ 48 levels "","0.00","0.01",..: 1 1 3 2 2 2 12 18 34 14 
...
 $ visible: logi TRUE

When you do that you can see the only the first item in the length2 list is 
likely to be useful:

> str(rain[[1]])
'data.frame':   341 obs. of  3 variables:
 $ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ date   : Factor w/ 62 levels "2013-12-01","2013-12-02",..: 32 33 34 35 36 37 
38 39 40 41 ...
 $ amount : Factor w/ 48 levels "","0.00","0.01",..: 1 1 3 2 2 2 12 18 34 14 ...

#So re-assign#

rain <- rain[[1]]

And the date column is a factor. Fortunately the as.Date.factor function 
doesn't need as.chaacter anymore:

rain$date=as.Date(rain$date)


> 
>  The ploting command used is:
> 
> xyplot(rain$amount ~ rain$date | rain$station, main="Weather Stations",
> xlab="Date", ylab="Amount (inches)", pch=16, col=132)
> 
>  Please point me to the appropriate place in the book where the prepanel
> function to change the axis lable spacing and rotation is discussed.

The place on the ?xyplot help page to look is in the section on `scales`. 
There's no difficulty using 'rot' as long as it is in the correct place which 
in this instance is `x` sublist of the `scales` list

xyplot(amount ~ date | station, data=rain, main="Weather Stations",
xlab="Date", ylab="Amount (inches)", pch=16, col=132, 
scales=list(y=list(at=0:4), 
x=list(at=seq(min(rain$date), max(rain$date), by='week'), 
rot=90) )
  )




> I
> expected it to be in chapter 8. Or, if there's another reference I should
> read, please point me to that.


> 
>  For some reason I've not yet tracked down, there is no longer help
> available within the R session (running in emacs with ESS) when I type, for
> example, ?xyplot. R returns the message that there's no documentation in the
> specified packages and libraries. Obviously something changed since I last
> used R.
> 
> Rich__
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard

On Fri, 14 Oct 2016, David Winsemius wrote:


rain <- source("~/raindata.dat")
str(rain)

List of 2
$ value  :'data.frame': 341 obs. of  3 variables:
 ..$ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1 ...
 ..$ date   : Factor w/ 62 levels "2013-12-01","2013-12-02",..: 32 33 34 35 36 
37 38 39 40 41 ...
 ..$ amount : Factor w/ 48 levels "","0.00","0.01",..: 1 1 3 2 2 2 12 18 34 14 
...
$ visible: logi TRUE


David,

  I left the station as a factor and changed the date using
as.Date(as.character...) and the amount using as.numeric.


When you do that you can see the only the first item in the length2 list
is likely to be useful:


  I'm not seeing to what the 'List of 2' refers in the data.frame.

  This is the script I sourced:

rain <- read.csv("daily_records.csv", header=T, sep=",")
require(lattice)
rain$date <- as.Date(as.character(rain$date))
rain$amount <- as.numeric(rain$amount)
xyplot(rain$amount ~ rain$date | rain$station, main="Weather Stations", xlab="Date", 
ylab="Amount (inches)", pch=20, col=132)

  What did I do incorrectly here?


And the date column is a factor. Fortunately the as.Date.factor function
doesn't need as.chaacter anymore:


  Oh. Thanks.


The place on the ?xyplot help page to look is in the section on `scales`.
There's no difficulty using 'rot' as long as it is in the correct place
which in this instance is `x` sublist of the `scales` list



xyplot(amount ~ date | station, data=rain, main="Weather Stations",
   xlab="Date", ylab="Amount (inches)", pch=16, col=132,
   scales=list(y=list(at=0:4),
   x=list(at=seq(min(rain$date), max(rain$date), by='week'), 
rot=90) )
 )


  That's what I missed: where the scales command is placed, and
understanding how to use all the components.

  I need to figure out why I'm no longer seeing the help files. As far as I
know they should be loaded when I invoke R.

Thanks very much,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread David Winsemius

> On Oct 14, 2016, at 3:51 PM, Rich Shepard  wrote:
> 
> On Fri, 14 Oct 2016, David Winsemius wrote:
> 
>>> rain <- source("~/raindata.dat")
>>> str(rain)
>> List of 2
>> $ value  :'data.frame':  341 obs. of  3 variables:
>> ..$ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1 ...
>> ..$ date   : Factor w/ 62 levels "2013-12-01","2013-12-02",..: 32 33 34 35 
>> 36 37 38 39 40 41 ...
>> ..$ amount : Factor w/ 48 levels "","0.00","0.01",..: 1 1 3 2 2 2 12 18 34 
>> 14 ...
>> $ visible: logi TRUE
> 
> David,
> 
>  I left the station as a factor and changed the date using
> as.Date(as.character...) and the amount using as.numeric.
> 
>> When you do that you can see the only the first item in the length2 list
>> is likely to be useful:
> 
>  I'm not seeing to what the 'List of 2' refers in the data.frame.
> 
>  This is the script I sourced:
> 
> rain <- read.csv("daily_records.csv", header=T, sep=",")
> require(lattice)
> rain$date <- as.Date(as.character(rain$date))
> rain$amount <- as.numeric(rain$amount)
> xyplot(rain$amount ~ rain$date | rain$station, main="Weather Stations", 
> xlab="Date", ylab="Amount (inches)", pch=20, col=132)
> 
>  What did I do incorrectly here?

Well, you didn't send a text file with the contents of "daily_records.csv"; 
rather you sent a text file that was R code that would return a data object. I 
assigned it to the name `rain` before I realized it was a two item list. I then 
fixed the problems that assignment and the factor Dates presented so that I 
could then give a `data=rain` parameter to the xyplot function.
> 
> 
>> And the date column is a factor. Fortunately the as.Date.factor function
>> doesn't need as.chaacter anymore:
> 
>  Oh. Thanks.
> 
>> The place on the ?xyplot help page to look is in the section on `scales`.
>> There's no difficulty using 'rot' as long as it is in the correct place
>> which in this instance is `x` sublist of the `scales` list
> 
>> xyplot(amount ~ date | station, data=rain, main="Weather Stations",
>>   xlab="Date", ylab="Amount (inches)", pch=16, col=132,
>>   scales=list(y=list(at=0:4),
>>   x=list(at=seq(min(rain$date), max(rain$date), by='week'), 
>> rot=90) )
>> )

Notice that the formula has just the column names rather than using `$`. But 
need to give `rain$date` to functions in hte scales list. It always seemed to 
me that the evaluation of names inside the scales list should also be evaluated 
inside the `data` environment but Deepayan didn't design it that way, so you 
need to "reach out" to get them pulled back in.

> 
>  That's what I missed: where the scales command is placed, and
> understanding how to use all the components.
> 
>  I need to figure out why I'm no longer seeing the help files. As far as I
> know they should be loaded when I invoke R.

So typing ?xyplot at the console doesn't bring up a help page? That would imply 
that you need to reinstall R.
> 
> Thanks very much,
> 
> Rich
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Split strings based on multiple patterns

2016-10-14 Thread David Winsemius

> On Oct 14, 2016, at 4:16 PM, Joe Ceradini  wrote:
> 
> Afternoon,
> 
> I unfortunately inherited a dataframe with a column that has many fields
> smashed together. My goal is to split the strings in the column into
> separate columns based on patterns.
> 
> Example of what I'm working with:
> 
> ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water
> pH:Unkwn:
> Conductivity:Unkwn: Water color: Clear: Water turbidity: clear:
> Manmade:no  Permanence:permanent:  Max water depth: <3: Primary
> substrate: Silt/Mud: Evidence of cattle grazing: none:
> Shoreline Emergent Veg(%): 1-25: Fish present: yes: Fish species: unkwn: no
> amphibians observed")
> ugly
> 
> Far as I can tell, there is not a single pattern that would work for
> splitting this string. Splitting on ":" is close but not quite consistent.
> Each of these attributes should be a separate column:
> 
> attributes <- c("Water temp", "Waterbody type", "Water pH", "Conductivity",
> "Water color", "Water turbidity", "Manmade", "Permanence", "Max water
> depth", "Primary substrate", "Evidence of cattle grazing", "Shoreline
> Emergent Veg(%)", "Fish present", "Fish species")
> 
> So, conceptually, I want to do something like this, where the string is
> split for each of the patterns in attributes. However, strsplit only uses
> the 1st value of attributes
> strsplit(ugly, attributes)
> 
> Should I loop through the values of "attributes"?
> Is there an argument in strsplit I'm missing that will do what I want?
> Different approach altogether?
> 
> Thanks! Happy Friday.
> Joe
> 
>   [[alternative HTML version deleted]]

Need to post in plain text. We cannot see where your "carriage returns" are 
located in that data. HTML uses some other character(s?) that doesn't get 
translated by our mailserver.


> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Yes, please do read that.

> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard

On Fri, 14 Oct 2016, David Winsemius wrote:


Notice that the formula has just the column names rather than using `$`.
But need to give `rain$date` to functions in hte scales list. It always
seemed to me that the evaluation of names inside the scales list should
also be evaluated inside the `data` environment but Deepayan didn't design
it that way, so you need to "reach out" to get them pulled back in.


David,

  Mea culpa. I left off the data argument.


So typing ?xyplot at the console doesn't bring up a help page? That would
imply that you need to reinstall R.


  Will rebuild and re-install tomorrow morning.

  Thanks again.

Carpe weekend,

Rich

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Split strings based on multiple patterns

2016-10-14 Thread Joe Ceradini
Afternoon,

I unfortunately inherited a dataframe with a column that has many fields
smashed together. My goal is to split the strings in the column into
separate columns based on patterns.

Example of what I'm working with:

ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water
pH:Unkwn:
Conductivity:Unkwn: Water color: Clear: Water turbidity: clear:
Manmade:no  Permanence:permanent:  Max water depth: <3: Primary
substrate: Silt/Mud: Evidence of cattle grazing: none:
Shoreline Emergent Veg(%): 1-25: Fish present: yes: Fish species: unkwn: no
amphibians observed")
ugly

Far as I can tell, there is not a single pattern that would work for
splitting this string. Splitting on ":" is close but not quite consistent.
Each of these attributes should be a separate column:

attributes <- c("Water temp", "Waterbody type", "Water pH", "Conductivity",
"Water color", "Water turbidity", "Manmade", "Permanence", "Max water
depth", "Primary substrate", "Evidence of cattle grazing", "Shoreline
Emergent Veg(%)", "Fish present", "Fish species")

So, conceptually, I want to do something like this, where the string is
split for each of the patterns in attributes. However, strsplit only uses
the 1st value of attributes
strsplit(ugly, attributes)

Should I loop through the values of "attributes"?
Is there an argument in strsplit I'm missing that will do what I want?
Different approach altogether?

Thanks! Happy Friday.
Joe

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
Hopefully this looks better. I did not realize gmail default was html.

I have a dataframe with a column that has many field smashed together.
I need to split the strings in the column into separate columns based
on patterns.

Example of a string that needs to be split:

ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water
pH:Unkwn: Conductivity:Unkwn: Water color: Clear: Water turbidity:
clear: Manmade:no  Permanence:permanent:  Max water depth: <3: Primary
substrate: Silt/Mud: Evidence of cattle grazing: none: Shoreline
Emergent Veg(%): 1-25: Fish present: yes: Fish species: unkwn: no
amphibians observed")
ugly

Far as I can tell, there is not a single pattern that would work for
splitting. Splitting on ":" is close, but not quite right. Each of the
below attributes should be in a separate column, and are present in
the string (above) that needs to be split:

attributes <- c("Water temp", "Waterbody type", "Water pH",
"Conductivity", "Water color", "Water turbidity", "Manmade",
"Permanence", "Max water depth", "Primary substrate", "Evidence of
cattle grazing", "Shoreline Emergent Veg(%)", "Fish present", "Fish
species")

Conceptually, I want to use the vector of attributes to split the
string. However, strsplit only uses the 1st value of the attributes
object:

strplit(ugly, attributes).

Should I loop through the values of "attributes"?
Is there an argument in strsplit I'm missing that will do what I want?
Different approach altogether?

Thanks! Happy Friday.
Joe

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
should be strsplit(ugly, attributes) not strplit(ugly, attributes)

On Fri, Oct 14, 2016 at 7:53 PM, Joe Ceradini  wrote:
> Hopefully this looks better. I did not realize gmail default was html.
>
> I have a dataframe with a column that has many field smashed together.
> I need to split the strings in the column into separate columns based
> on patterns.
>
> Example of a string that needs to be split:
>
> ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water
> pH:Unkwn: Conductivity:Unkwn: Water color: Clear: Water turbidity:
> clear: Manmade:no  Permanence:permanent:  Max water depth: <3: Primary
> substrate: Silt/Mud: Evidence of cattle grazing: none: Shoreline
> Emergent Veg(%): 1-25: Fish present: yes: Fish species: unkwn: no
> amphibians observed")
> ugly
>
> Far as I can tell, there is not a single pattern that would work for
> splitting. Splitting on ":" is close, but not quite right. Each of the
> below attributes should be in a separate column, and are present in
> the string (above) that needs to be split:
>
> attributes <- c("Water temp", "Waterbody type", "Water pH",
> "Conductivity", "Water color", "Water turbidity", "Manmade",
> "Permanence", "Max water depth", "Primary substrate", "Evidence of
> cattle grazing", "Shoreline Emergent Veg(%)", "Fish present", "Fish
> species")
>
> Conceptually, I want to use the vector of attributes to split the
> string. However, strsplit only uses the 1st value of the attributes
> object:
>
> strplit(ugly, attributes).
>
> Should I loop through the values of "attributes"?
> Is there an argument in strsplit I'm missing that will do what I want?
> Different approach altogether?
>
> Thanks! Happy Friday.
> Joe



-- 
Cooperative Fish and Wildlife Research Unit
Zoology and Physiology Dept.
University of Wyoming
joecerad...@gmail.com / 914.707.8506
wyocoopunit.org

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Duncan Murdoch

On 14/10/2016 10:00 AM, Narendra Modi wrote:

Hello Gurus,

I have built a code snippet using R.net wherein I call couple of R
scripts to run optimization packages and use the output in C# code.
The way I call the R scripts is just by providing its location in the
C# code.

So, if I have to share the .dll of the complete program, I will also
have to share the R scripts; actual code. Is there anyway to avoid it;
not having to share the r script code with users/testers.
I am considerably new to R. Any suggestion in this direction is appreciated!



I don't know what the R.net .dll is, but if it includes R, you need to 
share the complete source code of anything you distribute that includes 
it.  The R scripts will be only a small part of that.


Sharing less than that is a copyright violation, since you are only 
licensed to distribute R under the GPL license, and it requires that you 
share code of the original and your modifications.


Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Share R.net dll without having to share R script code?

2016-10-14 Thread Narendra Modi
Hello Gurus,

I have built a code snippet using R.net wherein I call couple of R
scripts to run optimization packages and use the output in C# code.
The way I call the R scripts is just by providing its location in the
C# code.

So, if I have to share the .dll of the complete program, I will also
have to share the R scripts; actual code. Is there anyway to avoid it;
not having to share the r script code with users/testers.
I am considerably new to R. Any suggestion in this direction is appreciated!

Regards,
NM

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Bob Rudis
Ugly idea/option, but you could base64 encode the R script (solely to
avoid the need to do string quoting) and have that string in the
source of the R.net code, then pass it in to the eval portion or write
it out to a temp dir and pass that to the eval portion of the code.
That way the script is embedded with the DLL and not an extra asset
that needs to be managed.

On Fri, Oct 14, 2016 at 10:43 AM, Narendra Modi  wrote:
> Thanks Duncan. That's useful to know.
>
> On Fri, Oct 14, 2016 at 9:18 AM, Duncan Murdoch
>  wrote:
>> On 14/10/2016 10:00 AM, Narendra Modi wrote:
>>>
>>> Hello Gurus,
>>>
>>> I have built a code snippet using R.net wherein I call couple of R
>>> scripts to run optimization packages and use the output in C# code.
>>> The way I call the R scripts is just by providing its location in the
>>> C# code.
>>>
>>> So, if I have to share the .dll of the complete program, I will also
>>> have to share the R scripts; actual code. Is there anyway to avoid it;
>>> not having to share the r script code with users/testers.
>>> I am considerably new to R. Any suggestion in this direction is
>>> appreciated!
>>>
>>
>> I don't know what the R.net .dll is, but if it includes R, you need to share
>> the complete source code of anything you distribute that includes it.  The R
>> scripts will be only a small part of that.
>>
>> Sharing less than that is a copyright violation, since you are only licensed
>> to distribute R under the GPL license, and it requires that you share code
>> of the original and your modifications.
>>
>> Duncan Murdoch
>>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Narendra Modi
Thanks Duncan. That's useful to know.

On Fri, Oct 14, 2016 at 9:18 AM, Duncan Murdoch
 wrote:
> On 14/10/2016 10:00 AM, Narendra Modi wrote:
>>
>> Hello Gurus,
>>
>> I have built a code snippet using R.net wherein I call couple of R
>> scripts to run optimization packages and use the output in C# code.
>> The way I call the R scripts is just by providing its location in the
>> C# code.
>>
>> So, if I have to share the .dll of the complete program, I will also
>> have to share the R scripts; actual code. Is there anyway to avoid it;
>> not having to share the r script code with users/testers.
>> I am considerably new to R. Any suggestion in this direction is
>> appreciated!
>>
>
> I don't know what the R.net .dll is, but if it includes R, you need to share
> the complete source code of anything you distribute that includes it.  The R
> scripts will be only a small part of that.
>
> Sharing less than that is a copyright violation, since you are only licensed
> to distribute R under the GPL license, and it requires that you share code
> of the original and your modifications.
>
> Duncan Murdoch
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Return.clean () - PerformanceAnalytics package

2016-10-14 Thread T.Riedle
Dear all,

I am trying to clean return data using the Return.clean() function in the 
PerformanceAnalytics package. Hence, my code looks as follows but I get an 
error message.



cleantest <- read.csv("D:/Studie_vola_difference/cleantest.csv")
data<-as.vector(cleantest)
test<-Return.clean(data,method="boudt",alpha=0.01)

Error in checkData(R, method = "xts") :
The data cannot be converted into a time series.  If you are trying to pass in 
names from a data object with one column, you should use the form 'data[rows, 
columns, drop = FALSE]'.  Rownames should have standard date formats, such as 
'1985-03-15'.



Can anybody help me on this error? What is wrong with my code?



Thanks for your support.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Subset and sumerize

2016-10-14 Thread Sarah Goslee
For the data you provide, it's simply:

summary(subset(dat, x1 == "x" & x2 == "z")$y)

Note that x1 and x2 are factors in your example.

We also don't know what you want to do if there are more than one
combination of that per ID, or if there ID values with no matching
rows.

Sarah

On Fri, Oct 14, 2016 at 2:26 PM, Ashta  wrote:
> Hi all,
>
> I am trying to summarize  big data set  by   selecting a row
> conditionally. and tried  to do it in a loop
>
> Here is  the sample of my data and my attempt
>
> dat<-read.table(text=" ID,x1,x2,y
> 1,a,b,15
> 1,x,z,21
> 1,x,b,16
> 1,x,k,25
> 2,d,z,31
> 2,x,z,28
> 2,g,t,41
> 3,h,e,32
> 3,x,z,38
> 3,x,g,45
> ",sep=",",header=TRUE)
>
> For  each unique ID,  I want to select  a data when x1= "x" and x2="z"
> Here is the selected data (newdat)
> ID,x1,x2,y
> 1,x,z,21
> 2,x,z,28
> 3,x,z,38
>
> Then I want summarize  Y values and out put as follows
> Summerize
> summary(newdat[i])
> ##
> ID   Min. 1st Qu.  MedianMean 3rd Qu.Max.
> 1
> 2
> 3
> .
> .
> .
> 28
> 
>
> Here is my attempt but did not work,
>
> trt=c(1:28)
> for(i  in 1:length (trt))
> {
>   day[i]= newdat[which(newdat$ID== trt[i] &  newdat$x1 =="x" &
> newdat$x2 =="z"),]
> NR[i]=dim(day[i])[1]
> print(paste("Number of Records  :", NR[i]))
> sm[i]=summary(day[i])
> }
>
> Thank you in advance
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard

  I've read chapters 7 and 8 in the Lattice book and do not see how to thin
labels on the x and y axes of an xyplot(), and how to rotate the dates on
the x axis for easier reading (rot did not do the job for me.)

  The data (as raindata.dat) and the existing plot (as precip.pdf) are
attached.

  The ploting command used is:

xyplot(rain$amount ~ rain$date | rain$station, main="Weather Stations",
xlab="Date", ylab="Amount (inches)", pch=16, col=132)

  Please point me to the appropriate place in the book where the prepanel
function to change the axis lable spacing and rotation is discussed. I
expected it to be in chapter 8. Or, if there's another reference I should
read, please point me to that.

  For some reason I've not yet tracked down, there is no longer help
available within the R session (running in emacs with ESS) when I type, for
example, ?xyplot. R returns the message that there's no documentation in the
specified packages and libraries. Obviously something changed since I last
used R.

Richstructure(list(station = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 
6L, 6L, 6L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 
2L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L), .Label = c("0.3E", 
"0.6W", "1.0WNW", "1.5N", "4.3WNW", "Airport"), class = "factor"), 
date = structure(c(32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 
40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 
52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 1L, 
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L
), .Label = c("2013-12-01", "2013-12-02", "2013-12-03", "2013-12-04", 
"2013-12-05", "2013-12-06", "2013-12-07", "2013-12-08", "2013-12-09", 
"2013-12-10", "2013-12-11", "2013-12-12", "2013-12-13", "2013-12-14", 
"2013-12-15", "2013-12-16", "2013-12-17", "2013-12-18", "2013-12-19", 
"2013-12-20", "2013-12-21", "2013-12-22", "2013-12-23", "2013-12-24", 
"2013-12-25", "2013-12-26", "2013-12-27", "2013-12-28", "2013-12-29", 
"2013-12-30", "2013-12-31", "2014-01-01", "2014-01-02", "2014-01-03", 
"2014-01-04", "2014-01-05", "2014-01-06", "2014-01-07", "2014-01-08", 
"2014-01-09", "2014-01-10", "2014-01-11", 

Re: [R] Subset and sumerize

2016-10-14 Thread Mark Sharp
Ashta,

## I may have misunderstood your question and if so I apologize.

## I had to remove the extra line after "45" before
## the ",sep=" to use your code.
## You could have used dput(dat) to send a more reliable (robust) version.
dat <- structure(list(ID = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L),
x1 = structure(c(1L, 5L, 5L, 5L, 2L, 5L, 3L, 4L, 5L, 5L), .Label = c("a",
"d", "g", "h", "x"), class = "factor"), x2 = structure(c(1L,
6L, 1L, 4L, 6L, 6L, 5L, 2L, 6L, 3L), .Label = c("b", "e",
"g", "k", "t", "z"), class = "factor"), y = c(15L, 21L, 16L,
25L, 31L, 28L, 41L, 32L, 38L, 45L)), .Names = c("ID", "x1",
"x2", "y"), class = "data.frame", row.names = c(NA, -10L))

# In your proposed solution "newdat" is never defined yet you are using it as 
if it were.

## It is my understanding that your goal is to define newdat as a
## subset of dat where x1 == "x" and x2 == "z".
## This can be done with one line.

newdat <- dat[dat$x1 == "x" & dat$x2 == "z", ]
newdat

> On Oct 14, 2016, at 1:26 PM, Ashta  wrote:
>
> Hi all,
>
> I am trying to summarize  big data set  by   selecting a row
> conditionally. and tried  to do it in a loop
>
> Here is  the sample of my data and my attempt
>
> dat<-read.table(text=" ID,x1,x2,y
> 1,a,b,15
> 1,x,z,21
> 1,x,b,16
> 1,x,k,25
> 2,d,z,31
> 2,x,z,28
> 2,g,t,41
> 3,h,e,32
> 3,x,z,38
> 3,x,g,45
> ",sep=",",header=TRUE)
>
> For  each unique ID,  I want to select  a data when x1= "x" and x2="z"
> Here is the selected data (newdat)
> ID,x1,x2,y
> 1,x,z,21
> 2,x,z,28
> 3,x,z,38
>
> Then I want summarize  Y values and out put as follows
> Summerize
> summary(newdat[i])
> ##
> ID   Min. 1st Qu.  MedianMean 3rd Qu.Max.
> 1
> 2
> 3
> .
> .
> .
> 28
> 
>
> Here is my attempt but did not work,
>
> trt=c(1:28)
> for(i  in 1:length (trt))
> {
>  day[i]= newdat[which(newdat$ID== trt[i] &  newdat$x1 =="x" &
> newdat$x2 =="z"),]
> NR[i]=dim(day[i])[1]
> print(paste("Number of Records  :", NR[i]))
> sm[i]=summary(day[i])
> }
>
> Thank you in advance
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

CONFIDENTIALITY NOTICE: This e-mail and any files and/or...{{dropped:10}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Incremental

2016-10-14 Thread Val
Thank you Rui,

It Worked!

How about if the first variable is date format? Like the following
dat<-read.table(text=" y1, flag
24-01-2016,S
24-02-2016,R
24-03-2016,X
24-04-2016,H
24-01-2016,S
24-11-2016,R
24-10-2016,R
24-02-2016,X
24-01-2016,H
24-11-2016,S
24-02-2016,R
24-10-2016,X
24-03-2016,H
24-04-2016,S
",sep=",",header=TRUE)
dat
dat$x1 <- cumsum(dat$flag == "S")
dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))

error message
In Ops.factor(y, y[1]) : ‘-’ not meaningful for factors



On Thu, Oct 13, 2016 at 5:30 AM, Rui Barradas  wrote:
> Hello,
>
> You must run the code to create x1 first, part 1), then part 2).
> I've tested with your data and all went well, the result is the following.
>
>> dput(dat)
> structure(list(y1 = c(39958L, 40058L, 40105L, 40294L, 40332L,
> 40471L, 40493L, 40533L, 40718L, 40771L, 40829L, 40892L, 41056L,
> 41110L, 41160L, 41222L, 41250L, 41289L, 41324L, 41355L, 41415L,
> 41562L, 41562L, 41586L), flag = structure(c(3L, 2L, 4L, 1L, 3L,
> 2L, 2L, 4L, 1L, 3L, 2L, 4L, 1L, 3L, 2L, 2L, 2L, 2L, 4L, 2L, 4L,
> 4L, 1L, 3L), .Label = c("H", "R", "S", "X"), class = "factor"),
> x1 = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
> 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), z2 = c(0L, 100L,
> 147L, 336L, 0L, 139L, 161L, 201L, 386L, 0L, 58L, 121L, 285L,
> 0L, 50L, 112L, 140L, 179L, 214L, 245L, 305L, 452L, 452L,
> 0L)), .Names = c("y1", "flag", "x1", "z2"), row.names = c(NA,
> -24L), class = "data.frame")
>
>
> Rui Barradas
>
>
> Em 12-10-2016 21:53, Val escreveu:
>>
>> Rui,
>> Thank You!
>>
>> the second one gave me NULL.
>> dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))
>>
>> dat$z2
>> NULL
>>
>>
>>
>> On Wed, Oct 12, 2016 at 3:34 PM, Rui Barradas 
>> wrote:
>>>
>>> Hello,
>>>
>>> Seems simple:
>>>
>>>
>>> # 1)
>>> dat$x1 <- cumsum(dat$flag == "S")
>>>
>>> # 2)
>>> dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))
>>>
>>> Hope this helps,
>>>
>>> Rui Barradas
>>>
>>>
>>> Em 12-10-2016 21:15, Val escreveu:


 Hi all,

 I have a data set like
 dat<-read.table(text=" y1, flag
 39958,S
 40058,R
 40105,X
 40294,H
 40332,S
 40471,R
 40493,R
 40533,X
 40718,H
 40771,S
 40829,R
 40892,X
 41056,H
 41110,S
 41160,R
 41222,R
 41250,R
 41289,R
 41324,X
 41355,R
 41415,X
 41562,X
 41562,H
 41586,S
 ",sep=",",header=TRUE)

 First sort the data by y1.
 Then
 I want to create two columns .
 1. the first new column is  (x1):  if flag is "S"  then  x1=1  and
 assign the following/subsequent rows 1 as well.   When we reach to
 the next "S"  then  x1=2 and the subsequent rows will be assigned to
 2.

 2. the second variable (z2). Within each x1 find the difference
 between the first y1 and subsequent y1 values

 Example  for the first few rows
 y1,   flag, x1, z2
 39958, S, 1,0  z2 is calculated as z2=(39958, 39958)
 40058, R, 1, 100 z2 is calculated as z2=(40058, 39958)
 40105, X, 1, 147 z2 is calculated as z2=(40105, 39958)
 40294, H, 1, 336 z2 is calculated as z2=(40294, 39958)
 40332, S, 2,  0z2 is calculated as z2=(40332, 40332)
 etc

 Here is the complete output for the sample  data
 39958,S,1,0
 40058,R,1,100
 40105,X,1,147
 40294,H,1,336
 40332,S,2,0
 40471,R,2,139
 40493,R,2,161
 40533,X,2,201
 40718,H,2,386
 40771,S,3,0
 40829,R,3,58
 40892,X,3,121
 41056,H,3,285
 41110,S,4,0
 41160,R,4,50
 41222,R,4,112
 41250,R,4,140
 41289,R,4,179
 41324,X,4,214
 41355,R,4,245
 41415,X,4,305
 41562,X,4,452
 41562,H,4,452
 41586,S,5,0

 Val

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

>>>
>

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Is there a way to prevent Rscript from opening help page when given an error

2016-10-14 Thread David Winsemius

> On Oct 13, 2016, at 2:36 PM, Tan, Johnny  wrote:
> 
> I posted this on stackoverflow but there hasn't been any replies, does anyone 
> know a solution for this?
> 
> 
> 
> 
> 
> I am running a script via command line using Rscript nameOfmyRscript. I 
> notice that when there is an error, my browser would open with the help page. 
> Now my script contained repeated errors of the same type so my browser had 10 
> tabs of the same help page. Is there a command or way to prevent R from 
> opening up these pages? I know that you can suppress all warnings by doing 
> option(warn=-1) and that you can use sink() to write errors and warnings to 
> file. I currently have the errors and warnings written to separate files, but 
> the help page keeps opening. I would prefer to not have any help pages open 
> at all.
> 
> The following error would open the mean.html help page
> 
> Error in mean.default(workshop) :
> 
> (converted from warning) argument is not numeric or logical: returning NA

That's not standard behavior, although I can see that it might be desired in a 
teaching situation. How was your installation of R created and on what 
operating system. (Answering those two questions and other useful advice  are 
offered in the Posting Guide which I would suggest you read in its entirety ... 
now ... before you draft a response.)
> 
> 
>Thanks
> -
> 
> The information contained in this e-mail message, and any attachment thereto, 
> is confidential and may not be disclosed without our express permission. If 
> you are not the intended recipient or an employee or agent responsible for 
> delivering this message to the intended recipient, you are hereby notified 
> that you have received this message in error and that any review, 
> dissemination, distribution or copying of this message, or any attachment 
> thereto, in whole or in part, is strictly prohibited. If you have received 
> this message in error, please immediately notify us by telephone, fax or 
> e-mail and delete the message and all of its attachments. Thank you. Every 
> effort is made to keep our network free from viruses. You should, however, 
> review this e-mail message, as well as any attachment thereto, for viruses. 
> We take no responsibility and have no liability for any computer virus which 
> may be transferred via this e-mail message.
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Subset and sumerize

2016-10-14 Thread Ashta
Hi all,

I am trying to summarize  big data set  by   selecting a row
conditionally. and tried  to do it in a loop

Here is  the sample of my data and my attempt

dat<-read.table(text=" ID,x1,x2,y
1,a,b,15
1,x,z,21
1,x,b,16
1,x,k,25
2,d,z,31
2,x,z,28
2,g,t,41
3,h,e,32
3,x,z,38
3,x,g,45
",sep=",",header=TRUE)

For  each unique ID,  I want to select  a data when x1= "x" and x2="z"
Here is the selected data (newdat)
ID,x1,x2,y
1,x,z,21
2,x,z,28
3,x,z,38

Then I want summarize  Y values and out put as follows
Summerize
summary(newdat[i])
##
ID   Min. 1st Qu.  MedianMean 3rd Qu.Max.
1
2
3
.
.
.
28


Here is my attempt but did not work,

trt=c(1:28)
for(i  in 1:length (trt))
{
  day[i]= newdat[which(newdat$ID== trt[i] &  newdat$x1 =="x" &
newdat$x2 =="z"),]
NR[i]=dim(day[i])[1]
print(paste("Number of Records  :", NR[i]))
sm[i]=summary(day[i])
}

Thank you in advance

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread David Winsemius

> On Oct 14, 2016, at 12:05 AM, Vijayakumar, Sowmya 
>  wrote:
> 
> Hi R-Help team,
> 
> 
> Greeting from AstraZeneca India!!
> 
> 
> 
> We are currently using *R 3.1.1* in Windows machine for one of our 
> application. We have a plan to upgrade the application. Please let us know 
> the steps to download the R which is compatible with *Oracle Enterprise Linux 
> (OEL) v6.5.*

I'm curious why you think we are supposed to know the answer to that question? 
I would think it should be asked of the people at Oracle.


> 
> Thanks,
> Sowmya
> 
> 
> 
> Confidentiality Notice: This message is private and may ...{{dropped:10}}
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread Bob Rudis
Having worked in big pharma for over 10 years, I'm _fairly_ certain
AstraZeneca can afford some paid R consulting.

On Fri, Oct 14, 2016 at 2:14 PM, David Winsemius  wrote:
>
>> On Oct 14, 2016, at 12:05 AM, Vijayakumar, Sowmya 
>>  wrote:
>>
>> Hi R-Help team,
>>
>>
>> Greeting from AstraZeneca India!!
>>
>>
>>
>> We are currently using *R 3.1.1* in Windows machine for one of our 
>> application. We have a plan to upgrade the application. Please let us know 
>> the steps to download the R which is compatible with *Oracle Enterprise 
>> Linux (OEL) v6.5.*
>
> I'm curious why you think we are supposed to know the answer to that 
> question? I would think it should be asked of the people at Oracle.
>
>
>>
>> Thanks,
>> Sowmya
>>
>> 
>>
>> Confidentiality Notice: This message is private and may ...{{dropped:10}}
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Incremental

2016-10-14 Thread Rui Barradas

Hello,

You have to convert y1 to class "Date" first, then do date arithmetic. 
The complete code would be



dat<-read.table(text=" y1, flag
24-01-2016,S
24-02-2016,R
24-03-2016,X
24-04-2016,H
24-01-2016,S
24-11-2016,R
24-10-2016,R
24-02-2016,X
24-01-2016,H
24-11-2016,S
24-02-2016,R
24-10-2016,X
24-03-2016,H
24-04-2016,S
",sep=",",header=TRUE)

str(dat)   # See what we have, y1 is a factor
dat$y1 <- as.Date(dat$y1, format = "%d-%m-%Y")
str(dat)   # now y1 is a Date

dat$x1 <- cumsum(dat$flag == "S")
dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))
dat


Instead of y - y[1] you can also use ?difftime.

Rui Barradas

Em 14-10-2016 20:06, Val escreveu:

Thank you Rui,

It Worked!

How about if the first variable is date format? Like the following
dat<-read.table(text=" y1, flag
24-01-2016,S
24-02-2016,R
24-03-2016,X
24-04-2016,H
24-01-2016,S
24-11-2016,R
24-10-2016,R
24-02-2016,X
24-01-2016,H
24-11-2016,S
24-02-2016,R
24-10-2016,X
24-03-2016,H
24-04-2016,S
",sep=",",header=TRUE)
dat
dat$x1 <- cumsum(dat$flag == "S")
dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))

error message
In Ops.factor(y, y[1]) : ‘-’ not meaningful for factors



On Thu, Oct 13, 2016 at 5:30 AM, Rui Barradas  wrote:

Hello,

You must run the code to create x1 first, part 1), then part 2).
I've tested with your data and all went well, the result is the following.


dput(dat)

structure(list(y1 = c(39958L, 40058L, 40105L, 40294L, 40332L,
40471L, 40493L, 40533L, 40718L, 40771L, 40829L, 40892L, 41056L,
41110L, 41160L, 41222L, 41250L, 41289L, 41324L, 41355L, 41415L,
41562L, 41562L, 41586L), flag = structure(c(3L, 2L, 4L, 1L, 3L,
2L, 2L, 4L, 1L, 3L, 2L, 4L, 1L, 3L, 2L, 2L, 2L, 2L, 4L, 2L, 4L,
4L, 1L, 3L), .Label = c("H", "R", "S", "X"), class = "factor"),
 x1 = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), z2 = c(0L, 100L,
 147L, 336L, 0L, 139L, 161L, 201L, 386L, 0L, 58L, 121L, 285L,
 0L, 50L, 112L, 140L, 179L, 214L, 245L, 305L, 452L, 452L,
 0L)), .Names = c("y1", "flag", "x1", "z2"), row.names = c(NA,
-24L), class = "data.frame")


Rui Barradas


Em 12-10-2016 21:53, Val escreveu:


Rui,
Thank You!

the second one gave me NULL.
dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))

dat$z2
NULL



On Wed, Oct 12, 2016 at 3:34 PM, Rui Barradas 
wrote:


Hello,

Seems simple:


# 1)
dat$x1 <- cumsum(dat$flag == "S")

# 2)
dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1]))

Hope this helps,

Rui Barradas


Em 12-10-2016 21:15, Val escreveu:



Hi all,

I have a data set like
dat<-read.table(text=" y1, flag
39958,S
40058,R
40105,X
40294,H
40332,S
40471,R
40493,R
40533,X
40718,H
40771,S
40829,R
40892,X
41056,H
41110,S
41160,R
41222,R
41250,R
41289,R
41324,X
41355,R
41415,X
41562,X
41562,H
41586,S
",sep=",",header=TRUE)

First sort the data by y1.
Then
I want to create two columns .
1. the first new column is  (x1):  if flag is "S"  then  x1=1  and
assign the following/subsequent rows 1 as well.   When we reach to
the next "S"  then  x1=2 and the subsequent rows will be assigned to
2.

2. the second variable (z2). Within each x1 find the difference
between the first y1 and subsequent y1 values

Example  for the first few rows
 y1,   flag, x1, z2
39958, S, 1,0  z2 is calculated as z2=(39958, 39958)
40058, R, 1, 100 z2 is calculated as z2=(40058, 39958)
40105, X, 1, 147 z2 is calculated as z2=(40105, 39958)
40294, H, 1, 336 z2 is calculated as z2=(40294, 39958)
40332, S, 2,  0z2 is calculated as z2=(40332, 40332)
etc

Here is the complete output for the sample  data
39958,S,1,0
40058,R,1,100
40105,X,1,147
40294,H,1,336
40332,S,2,0
40471,R,2,139
40493,R,2,161
40533,X,2,201
40718,H,2,386
40771,S,3,0
40829,R,3,58
40892,X,3,121
41056,H,3,285
41110,S,4,0
41160,R,4,50
41222,R,4,112
41250,R,4,140
41289,R,4,179
41324,X,4,214
41355,R,4,245
41415,X,4,305
41562,X,4,452
41562,H,4,452
41586,S,5,0

Val

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.







__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R-es] OT: Petición en pro de la reutilización de los microdatos del CIS

2016-10-14 Thread Rubén Gómez Antolí
Hola:

El 13/10/16 a las 17:18, Carlos J. Gil Bellosta  escribió:
> Hola, ¿qué tal?
> 
> Me vais a excusar que mande a la lista un mensaje marginalmente "off topic"
> y de interés principalmente para parte de los usuarios de R de España.
> Además, el mensaje está ya publicado en otra lista.

[...]

> El objetivo es que el CIS facilite la importación de los microdatos que
> cuelga en su banco de datos, incluidos los barómetros mensuales.

[...]

> Creo que es una petición razonable y que de contar el con el número
> suficiente de apoyos dará razones adicionales a quienes desde dentro del
> CIS (me consta) abogan por mejorar el acceso a la información que genera el
> centro.
> 
> Así que si la apoyáis y difundís contribuiréis a acelerar un proceso a
> todas luces conveniente. Además de que lo agradeceré muchísimo.

A mi me parece más que razonable y por eso la he firmado y le he dado
difusión entre la comunidad almeriense del Hacklab Almería:

https://foro.hacklabalmeria.net/t/microdatos-del-cis-peticion-para-su-reutilizacion/7678

Gracias por la iniciativa Carlos.

Salud y Revolución.

Lobo.
-- 
Libertad es poder elegir en cualquier momento. Ahora yo elijo GNU/Linux,
para no atar mis manos con las cadenas del soft propietario.
Porque la libertad no es tu derecho, es tu responsabilidad.
http://www.mucharuina.com
-
Desde El Ejido, en Almería, usuario registrado Linux #294013
http://www.counter.li.org

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] ciclo for para gráficos

2016-10-14 Thread javier.ruben.marcuzzi
Estimados

Tengo un problema que resumo en lo siguiente:

Primero hago un bucle for, algo como puede ser este esquema

For( i in datos)
{
Preparo para gráfico 1 <- ……..
Preparo para gráfico 2 <- ……..
Preparo para gráfico 3 <- ……..
Preparo para gráfico 4 <- ……..
}

Hasta aquí no hay errores (R procesa)

Parte dos, preparo un gráfico para un elemento de la lista, donde están los 
cuatro gráficos que deseo dentro de un par(mfrow=c(2,2))

Los cuatro gráficos se crean correctamente dentro de un gráfico que los engloba.

Parte tres, dentro del ciclo for coloco la parte de gráfico, genéticamente es 
algo como:

For( i in datos)
{
Preparo para gráfico 1 <- ……..
Preparo para gráfico 2 <- ……..
Preparo para gráfico 3 <- ……..
Preparo para gráfico 4 <- ……..

par(mfrow=c(2,2))

plot(para gráfico 1)
plot(para gráfico 2)
plot(para gráfico 3)
plot(para gráfico 4)

}

Esto da algo más de 200 gráficos compuestos por cuatro cada uno.

En principio funciona todo, salvo que luego de realizar varios gráficos el 
ciclo da el siguiente error
   
Error in plot.window(...) : se necesitan valores finitos de 'xlim'
Además: Warning messages:
1: In max(vertex.size) : ningun argumento finito para max; retornando -Inf
2: In min(x) : ningún argumento finito para min; retornando Inf
3: In max(x) : ningun argumento finito para max; retornando -Inf
4: In min(x) : ningún argumento finito para min; retornando Inf
5: In max(x) : ningun argumento finito para max; retornando -Inf

Me llama la atención, en la preparación de datos el ciclo for corre para todos, 
pero luego al graficar y correr cierta cantidad de elementos del ciclo aparece 
el error, cuando ya grafico varios. 

Por las dudas, son gráficos con igraph, donde el ciclo es sobre elementos del 
vertex (un tamaño tiene porque existe).

¿Alguna idea?

Javier Rubén Marcuzzi


[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es