[R] SWATplusR package problems

2021-09-07 Thread Wray, Nicholas M via R-help
I am trying to get to grips with the SWAT+ hydrological model and with the package SWATplusR which is meant instantiate SWAT+ into R. I have going through the code supplied on this website https://github.com/chrisschuerz/SWATplusR/blob/master/vignettes/SWATplusR.Rmd I can get so far, as shown

[R] Fwd: Re: Reading xpt files into R

2018-04-14 Thread WRAY NICHOLAS via R-help
Original Message -- From: WRAY NICHOLAS <nicholas.w...@ntlworld.com> To: peter dalgaard <pda...@gmail.com> Date: 14 April 2018 at 20:18 Subject: Re: [R] Reading xpt files into R Well yesterday I'd downloaded the "foreign" package and tried to op

[R] Reading xpt files into R

2018-04-13 Thread WRAY NICHOLAS via R-help
Hello R folk I have an xpt file which I have been trying to open into R in R studio On the net I found guidance which says that I need packages Hmisc and SASxport which I have successfully loaded. I had also found some code which says that this would allow me to read the xpt file into R:

[R] Limit in Directory Hierarchy?

2018-03-25 Thread WRAY NICHOLAS via R-help
A quick question - is there a limit to the number of levels one can go down when setting the directory in R studio? I ask because I have been trying to set the directory to a folder 8 levels down which R studio won't allow, and when I try to set the directory through Session/Set Working

[R] Problems with "predict" function ii

2018-01-31 Thread WRAY NICHOLAS via R-help
I have realised that I should have used "detach" before attaching another dataframe, but even when I do this it's still giving me lots of lines, rather than just one: My code: m<-runif(1,0,1) m mres<-m*(seq(1,12)) mres ssd<-rexp(1,1) ssd devs<-rep(0,length(mres)) for(i in

[R] Problems with "predict" function

2018-01-31 Thread WRAY NICHOLAS via R-help
Hello, I am synthesising some sales data over a twelve month period, and then trying to use the "predict" function, firstly to generate a thirteenth month forecast with upper and lower 95% confidence limits. So far so good But what I then want to do is add the upper sales value at the 95th

[R] Data invisible to read.csv

2017-11-01 Thread WRAY NICHOLAS via R-help
Hello This relates to trying to upload csv files to R. Essentially I have some v large csv files, but in the column where the dates are appears the column entry "00:00.0" for every line. But in the formula bar appears a date as well, for example "01/04/09 00:00.0", and this never appears in

Re: [R] Rainbow in loop

2017-06-08 Thread WRAY NICHOLAS
inbow(3)[2] > rainbow(3)[3] > > ... solve your issue? > > B. > > > > > > > On Jun 8, 2017, at 8:20 AM, WRAY NICHOLAS <nicholas.w...@ntlworld.com> > > wrote: > > > > Hi R folk I have a distance time graph for a l

[R] Rainbow in loop

2017-06-08 Thread WRAY NICHOLAS
Hi R folk I have a distance time graph for a locomotive and at various times different events occur on board the loco. I want to put a vertical line on the speed time graph for each event, but I want to colour each different kind of event differently to see visually whether there's any pattern

Re: [R] Novice users in need of urgent help with boxplots

2017-02-28 Thread WRAY NICHOLAS
The first thing you need to do is to read your data in. Convert your excel file to a csv file, say mydata.csv, and make sure that you know where it is eg folder "Datafile" on C drive. Then use setwd("C:/Datafile") and then read.csv("mydata.csv") That should upload it and you can trawl

[R] reading file labels into R

2017-01-27 Thread WRAY NICHOLAS
Hello R-ren I have a list of csv files in a folder which are labelled essentially in this way (actual data has scores of files) F010116, F020116, F030116 G020116, G030116, G040116, G 050116 H020116, H030116 where F G and H are engines I've got data from and the numbers are the dates. I can

Re: [R] Partial Fraction Decomposition

2016-11-27 Thread WRAY NICHOLAS
I am not aware that R really does symbolic manipulation in the way which you want, but I would have thought that this process would make a very pretty little problem to solve for you yourself, in that you could write a programme to analyse the original expression as a string of characters, whose

[R] Where are the PCA outputs?

2016-09-12 Thread WRAY NICHOLAS
Hi R Folk I have been kicking some data around and one thing has been to try a PC analysis on it, but whereas in the online examples I've looked at the prcomp function gives a set of five outputs when I use the prcomp function it only gives me a set of standard deviations and the rotation matrix

[R] Changing Index Labelling on x axis

2016-07-22 Thread WRAY NICHOLAS
Hi I have a vector of data (for example c(2,3,4,5,4,3,2) data<-c(2,3,4,5,4,3,2) plot(data) I simply want to up the index values along the x axis by 2, so that instead of 1, I have 3, instead of 2 I have 4 etc etc. Despite ages playing around with the axis function I can't get it to work, and

Re: [R] if else condition - help

2016-05-22 Thread WRAY NICHOLAS
Hi Adrian I'm not sure that you need to use the ifelse here. You can simply assign values ina vector or matrix using a simple condition -- here is a simple example: v<-c(4,5,6,7) v1<-v v1[]<-0 v1[v<5]<--1 v1[v>6]<-1 v1 Nick > > On 22 May 2016 at 18:58 Adrian Johnson

[R] Fwd: Re: Using read.csv() to import data

2016-04-24 Thread WRAY NICHOLAS
You probably have not reset the directory -- go to the session tab on the R window, click and go to “set working directory” as C Nick Original Message -- From: WRAY NICHOLAS <nicholas.w...@ntlworld.com> To: Jason Hernandez <jason.hernande...@yahoo.com> Date: 24 Apri

[R] Getting rid of unwanted csv files

2015-11-18 Thread WRAY NICHOLAS
Hi I have got a large folder with hundreds of csv files in it The problem is that some of them are junk, and I know which ones are junk because they were created on certain days, that is before I had honed the programme generating them to ultimate perfection I'd like to get shot of the junk

Re: [R] Creating "Envelope" around a plot

2015-11-02 Thread WRAY NICHOLAS
ou want, I suggest that you consult ?polygon to draw > a shaded region between the boundary lines. I'll leave that as > homework for you - see the examples section to see how to close the > polygon. > > Dennis > > On Mon, Nov 2, 2015 at 4:33 AM, WRAY NICHOL

[R] Fwd: Re: Creating "Envelope" around a plot

2015-11-02 Thread WRAY NICHOLAS
> -- Original Message -- > From: WRAY NICHOLAS <nicholas.w...@ntlworld.com> > To: Duncan Murdoch <murdoch.dun...@gmail.com>, r-help > <r-help@missing_domain> > Date: at > Subject: Re: [R] Creating "Envelope" around

Re: [R] Fwd: Re: Creating "Envelope" around a plot

2015-11-02 Thread WRAY NICHOLAS
ces of line segments is more difficult. > > Bill Dunlap > TIBCO Software > wdunlap<http://tibco.com> > > On Mon, Nov 2, 2015 at 7:19 AM, WRAY NICHOLAS < nicholas.w...@ntlworld.com > <mailto:nicholas.w...@ntlworld.com> > wrote: > &

[R] Creating "Envelope" around a plot

2015-11-02 Thread WRAY NICHOLAS
Hi I am plotting various strands of information, and I want to create an "envelope" around each line, so that the locus of the envelope is the boundary points no more than a fixed maximum distance from the plotted line, a bit like drawing a larger rectangle with paralle sides and curved compass

Re: [R] Why can I reset directory in using setwd on desktop but not on laptop

2015-10-09 Thread WRAY NICHOLAS
> -- Original Message -- > From: WRAY NICHOLAS <nicholas.w...@ntlworld.com> > To: peter dalgaard <pda...@gmail.com> > Date: 09 October 2015 at 21:33 > Subject: Re: [R] Why can I reset directory in using setwd on desktop but > no

Re: [R] Why can I reset directory in using setwd on desktop but not on laptop

2015-10-09 Thread WRAY NICHOLAS
part of the write.csv() or other output > command; you don't need to change the working directory necessarily. > > Sarah > > On Fri, Oct 9, 2015 at 11:43 AM, WRAY NICHOLAS > <nicholas.w...@ntlworld.com> wrote: > > Hi I am running the same r routine on b

[R] Why can I reset directory in using setwd on desktop but not on laptop

2015-10-09 Thread WRAY NICHOLAS
Hi I am running the same r routine on both my desktop and my laptop, and writing results in the form of csv files into storage folders in the respective users/documents files of both machines My desktop machine allows me to reset the directory in the course of the r programme so that I can write

Re: [R] Unordered combinations with repetition

2015-06-09 Thread WRAY NICHOLAS
You could try expand.grid -- you'd prob need to modify what's beneath *a=c(0,1,2)* *b=c(0,1)* *c=c(0,1)* *y-list()* *y[[1]]-a* *y[[2]]-b* *y[[3]]-c* *expand.grid(y)* This code gives all combinations On 9 June 2015 at 10:11, Thomas Chesney thomas.ches...@nottingham.ac.uk wrote: Does

[R] Fwd: Arrays of variable dimensionality

2015-05-31 Thread WRAY NICHOLAS
Thanks for all the ideas I will run through them next week when I'm back at work... Nick -- Forwarded message -- From: WRAY NICHOLAS nicholas.w...@ntlworld.com Date: 30 May 2015 at 11:29 Subject: Arrays of variable dimensionality To: r-help r-help@r-project.org Hello folks

[R] Arrays of variable dimensionality

2015-05-30 Thread WRAY NICHOLAS
Hello folks Supposing I have a multidimensional array in an R prog, say a 4D array. I want the coordinate quantities to be read off from a vector. The values in the vector (vec) are generated by a function. This is easy if the number of dimensions is fixed for both the array and the number of

Re: [R] Issues with loading csv file

2015-05-25 Thread WRAY NICHOLAS
Something you could try is to put a small csv file into a location and set the word to that and see whether it's finding it eg setwd(C:/Users/Shivi/Documents/) open this file, stick a csv doc and see whether R will read it Nick On 25 May 2015 at 13:19, Shivi82 shivibha...@ymail.com wrote: HI

[R] Variable number of loops

2015-05-16 Thread WRAY NICHOLAS
I am trying to build a programme which will work out the permutations of a number of variables, eg a=0 to 1, b=0 to 1, and c=0 to 2, so permutations would be (0,0,0), (1,0,0), (0,1,0)... etc In this case there would be 2 x 2x 3 = 12 permutations. If the number of variables are fixed it's easy to