Re: [R] (no subject)

2016-02-07 Thread Jim Lemon
Hi Walter, To make sure that the current R working directory is what you think it is: getwd() If it is not what you want, you can change it with: setwd("C:/Program Files/R/R-3.2.3/Appendix") Notice that I have changed the backslashes (\) to slashes (/). You can also use doubled backslashes if y

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
On 07/02/2016 7:14 PM, Ben Tupper wrote: Hi, On Feb 7, 2016, at 6:24 PM, Duncan Murdoch wrote: On 07/02/2016 6:12 PM, Robert Sherry wrote: I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just

Re: [R] Variable Argument Function

2016-02-07 Thread Robert Sherry
Ben, Your solution solved my issue. Thank you. I do not see a need for a nested function. Based upon your solution, I came up with this solution: fbob = function (...) { l1 = list(...) for( i in 1:length(l1) ) cat( "i is ", l1[[i]], "\n" ) return (0); } It does not use nes

Re: [R] Variable Argument Function

2016-02-07 Thread Ben Tupper
Hi, > On Feb 7, 2016, at 6:24 PM, Duncan Murdoch wrote: > > On 07/02/2016 6:12 PM, Robert Sherry wrote: >> >> I would like to write a function in R that would take a variable number >> of integers as parameters. I do not have a pressing reason to do this, I >> am just trying to learn R. I thoug

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
On 07/02/2016 6:12 PM, Robert Sherry wrote: I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just trying to learn R. I thought a good first step would be to print out the arguments. So I wrote the

Re: [R] Setting directory in Windows

2016-02-07 Thread Duncan Murdoch
I added an informative subject line; that's a good idea in this list so people can choose whether to read your question or not. On 07/02/2016 3:18 PM, Walter Niessen wrote: Helpers, I am a pretty savvy computer user (over 40 years) but am having trouble with the most basic process in using th

[R] Variable Argument Function

2016-02-07 Thread Robert Sherry
I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just trying to learn R. I thought a good first step would be to print out the arguments. So I wrote the following function: f1 = function (...)

Re: [R] Basic Problem with Data Input

2016-02-07 Thread Ben Tupper
Hi, Using the full path specification, as you have done in your second example, is a good idea. Have you tried forward slashes? If I am reading the docs correctly you should be able to use either forward or back slashes. I haven't used R in Windows for ages, but my memory is that switching

Re: [R] Basic Problem with Data Input

2016-02-07 Thread Sarah Goslee
Hi Walter, I'm not sure changing the shortcut properties are the best approach. Instead, after you start R, you can use the getwd() command to see where R will start looking for things, and the setwd() command to change that (wd is working directory). Because of the way R parses strings, you eith

Re: [R] [FORGED] Plot step function

2016-02-07 Thread jupiter
Thanks Jim, that was I did to generate graphic from plot(c(-4,0,4),c(0,1,1),type="s",xlab="x",ylab="y"), it displayed [-4, -2, 0, 2, 4] in X, I tried to twist it, but could not get [-4, -3, -2, -1, 0, 1, 2, 3, 4] in X. Also, that the y 0.0 is above the X axis. I guess I try to figure out if, in ge

[R] Basic Problem with Data Input

2016-02-07 Thread Walter Niessen
Helpers, I am a pretty savvy computer user (over 40 years) but am having trouble with the most basic process in using the R program. I am taking a course to learn the statistics utility of “R” but can’t seem to get past the opening where it shows the student how to input data into R. It sugge

[R] (no subject)

2016-02-07 Thread Walter Niessen
Helpers, I am a pretty savvy computer user (over 40 years) but am having trouble with the most basic process in using the R program. I am taking a course to learn the statistics utility of “R” but can’t seem to get past the opening where it shows the student how to input data into R. It sugge

Re: [R] Combining a character array into a character string

2016-02-07 Thread Erin Hodgess
Back again. I ran the paste with collapse and it worked this time. Spooky. Sorry for the trouble. Erin On Sun, Feb 7, 2016 at 3:24 PM, Erin Hodgess wrote: > Hello everyone! > > I'm sure this is very simple and that I'm just having "forest and trees" > syndrome. > > I have the following chara

[R] Combining a character array into a character string

2016-02-07 Thread Erin Hodgess
Hello everyone! I'm sure this is very simple and that I'm just having "forest and trees" syndrome. I have the following character array: > xxy [1] "A" "G" "C" "G" "T" I want to end up with "AGCGT:" I've tried paste, paste0, gsub, no good. Any suggestions much appreciated. Thanks and have a g

Re: [R] [FORGED] Plot step function

2016-02-07 Thread Jim Lemon
Hail Jupiter, Might a slight alteration of Rolf's suggestion do the trick? plot(c(-4,0,4),c(0,1,1),type="s",xlab="x",ylab="y") Jim On Sun, Feb 7, 2016 at 8:49 AM, jupiter wrote: > Thank you for the all response, how can the point y (0.0) on the same x > axis, and X increases 1 between [-4, 4]

Re: [R] five multiple plots with ggplot

2016-02-07 Thread Jeff Newmiller
Looks like the data frame needs to be reshaped before being given to ggplot. "melt" function from the "reshape2" package, or "gather" function from "tidyr" package are good tools for this. On Sun, 7 Feb 2016, Ulrik Stervbo wrote: Hi Stefano, you try to facet on 'variable' and 'scales' whic

Re: [R] five multiple plots with ggplot

2016-02-07 Thread Ulrik Stervbo
Hi Stefano, you try to facet on 'variable' and 'scales' which aren't part of your data.frame as far as I can see. The error 'At least one layer must contain all variables used for facetting' also tells you this - that at least one of the variables you use for facetting are missing. Hope this help

[R] five multiple plots with ggplot

2016-02-07 Thread Stefano Sofia
Dear list users, I would like to have multiple plots in one page with ggplot, in particular five graphs: in the central plot the snow cover (hs) of two meteorological stations; above wind direction and temperature of one of the two stations and below wind direction and temperature of the other s

Re: [R] rfImpute() error-- while missing imputation --

2016-02-07 Thread Sandeep Rana
Oh! It was a typo. ntree=800 was to be specified. Thanks Bret. > .On 07-Feb-2016, at 8:58 PM, Bert Gunter wrote: > > 5800 **not 5, 800** , no commas and no spaces. > > Please read an R tutorial or two to learn how to properly work with R > if this is not merely a typo. > > -- Bert > Bert Gunte

Re: [R] reading in multiple data sets in 2 loops

2016-02-07 Thread Reka Howard
Thank you very much for all of the help!!! For what I need, Jim's and Jeff's solutions were the most useful, but I really appreciate all of the help I got. On Sat, Feb 6, 2016 at 2:01 PM, Jeff Newmiller wrote: > Normally one wants not only to read the data, but to save it in an object > as well.

Re: [R] rfImpute() error-- while missing imputation --

2016-02-07 Thread Bert Gunter
5800 **not 5, 800** , no commas and no spaces. Please read an R tutorial or two to learn how to properly work with R if this is not merely a typo. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breat

[R] rfImpute() error-- while missing imputation --

2016-02-07 Thread Sandeep Rana
Hi, While executing rfImpute() in order to impute missing values in the data set I receive below error : | Out-of-bag | Tree | MSE %Var(y) | 800 | 2.979e+04 1.02 | Error in prox[miss, -miss, drop = FALSE] %*% xf[, j][-miss] : requires numeric/complex matrix/vector argume

Re: [R] reading in multiple data sets in 2 loops

2016-02-07 Thread Marc Girondot
Try this: # install package HelpersMG from CRAN including dependencies install.packages("HelpersMG") # Update to the lastest version install.packages("http://www.ese.u-psud.fr/epc/conservation/CRAN/HelpersMG.tar.gz";, repos=NULL, type="source") # Use the function read_folder() library("Helpers

[R] evaluation + Re: hourly prediction time series

2016-02-07 Thread AURORA GONZALEZ VIDAL
Thank you, it works fine. Now, I am trying to evaluate the performance of the model across time. So as to do that I use rolling window which I understand as sort of a "leave one out". The example: The data are from the 1st of January to nowadays so, I use data from the 1st of January to the 1s