Re: [R] Variable and value labels

2023-07-13 Thread Anupam Tyagi
😉 > > > > But seriously, we often are like new users even when we once knew a bit > about something. The R from before 2003 (or was it S?) has evolved quite a > bit. If, like me, you have used lots of other computer languages in > between, then they often blend in your mind

Re: [R] Variable and value labels

2023-07-13 Thread avi.e.gross
and methods and of course quirks. And, of course, I sympathize with adjusting from other environments designed for somewhat more specific purposes like Stata as R is more of a general purpose programming language. Often people start with those others and then come to R because they need to

Re: [R] Variable and value labels

2023-07-12 Thread Anupam Tyagi
ten in R, you may see how it does something and take a part of the code > and use it yourself. > > > > -Original Message- > From: R-help On Behalf Of Anupam Tyagi > Sent: Tuesday, July 11, 2023 11:49 PM > To: r-help mailing list > Subject: [R] Variable and value la

Re: [R] Variable and value labels

2023-07-12 Thread Adrian Dușa
Anupam, This is very general, and it also depends on the scientific domain. Factors do solve the value labels, but they drop the (original) values. They also lose the connection to the different types of missing values (an important topic in the social sciences). Base R provides as much as it can

Re: [R] Variable and value labels

2023-07-12 Thread avi.e.gross
To: r-help mailing list Subject: [R] Variable and value labels Hello, is there an easy way to do variable and value labels (for factor variables) in base-R, without using a package. If not, what is an easy and good way to do labels, using an add-on package. -- Anupam. [[alternati

Re: [R] Variable and value labels

2023-07-12 Thread Anupam Tyagi
p [mailto:r-help-boun...@r-project.org] On Behalf Of Anupam > Tyagi > >Sent: Wednesday, 12 July, 2023 14:11 > >To: Martin Maechler > >Cc: r-help mailing list > >Subject: Re: [R] Variable and value labels > > > >Thanks. Sorry, I have not consulted help pages, bu

Re: [R] Variable and value labels

2023-07-12 Thread Viechtbauer, Wolfgang (NP)
Original Message- >From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Anupam Tyagi >Sent: Wednesday, 12 July, 2023 14:11 >To: Martin Maechler >Cc: r-help mailing list >Subject: Re: [R] Variable and value labels > >Thanks. Sorry, I have not consulted help

Re: [R] Variable and value labels

2023-07-12 Thread Anupam Tyagi
Thanks. Sorry, I have not consulted help pages, but did a web search. Web search results are referring to some package or the other for doing labels. Thanks for letting me know that this can be done in base-R. I will try to find the relevant information in R documentation. On Wed, 12 Jul, 2023, 1:

Re: [R] Variable and value labels

2023-07-12 Thread Martin Maechler
> Anupam Tyagi > on Wed, 12 Jul 2023 09:18:55 +0530 writes: > Hello, > is there an easy way to do variable and value labels (for > factor variables) in base-R, without using a package. Yes, there are many. How many help pages (in R , i.e. base-R) did you consult? Very

[R] Variable and value labels

2023-07-11 Thread Anupam Tyagi
Hello, is there an easy way to do variable and value labels (for factor variables) in base-R, without using a package. If not, what is an easy and good way to do labels, using an add-on package. -- Anupam. [[alternative HTML version deleted]] ___

Re: [R] Variable labels

2021-05-15 Thread Steven Yen
Thanks. On 2021/5/16 侊捈 11:52, Robert Knight wrote: > Hi Steven, > > You make great sense wanting to have labels for your variables.   When > in RStudio, the little arrow beside "mydata" in the Environment tab > can be clicked and you see all the variables there.  And so you would > like to see

Re: [R] Variable labels

2021-05-15 Thread Robert Knight
Actually, I just found exactly what you want. Before that though, I am having a hard time finding any such cool job despite having even had classes with some great professors in economics at UND, and so I work in a completely non data related thing. Here is exactly what you want, code included.

Re: [R] Variable labels

2021-05-15 Thread Robert Knight
Hi Steven, You make great sense wanting to have labels for your variables. When in RStudio, the little arrow beside "mydata" in the Environment tab can be clicked and you see all the variables there. And so you would like to see a description under the variable names. Here is one way to accom

Re: [R] Variable labels

2021-05-14 Thread John Dougherty via R-help
On Fri, 14 May 2021 17:20:20 +0800 Steven Yen wrote: > Thanks to all, for bearing with me. > > Now I realize expss may not be what I need. I have now written a > self-runnable, replicable set of codes (listed below). Perhaps that > gives an idea of what I need. Question is, whethet this is the

Re: [R] Variable labels

2021-05-14 Thread David Carlson
which behaves like the one you get? Use > save/load. > You want to do something different? So please explain what exactly. > > Cheers > Petr > > > > -Original Message- > > From: Steven Yen > > Sent: Thursday, May 13, 2021 5:53 PM > > To: PIKAL Petr

Re: [R] Variable labels

2021-05-14 Thread Deepayan Sarkar
e data file just use attr. > > > > attr(mydata, "var.labels") <- definitions$var.labels > > > > attributes(mydata) > > $names > > [1] "id" "age" "yrmarry" > > > > $class > > [1] "data.f

Re: [R] Variable labels

2021-05-14 Thread PIKAL Petr
> Sent: Friday, May 14, 2021 12:48 PM > To: PIKAL Petr > Cc: R-help Mailing List > Subject: Re: [R] Variable labels > > Never mind what I said about "Clickable". All I meant was I created an item > "definitions" that appears after I load the binary file, and th

Re: [R] Variable labels

2021-05-14 Thread Steven Yen
ttributes(mydata) $names [1] "id" "age" "yrmarry" $class [1] "data.frame" $row.names [1] 1 2 3 4 5 6 $var.labels [1] "Individual ID" "Age in Years" "Years of marriage" Cheers Petr -Original Message- Fr

Re: [R] Variable labels

2021-05-14 Thread PIKAL Petr
quot; "age" "yrmarry" $class [1] "data.frame" $row.names [1] 1 2 3 4 5 6 $var.labels [1] "Individual ID" "Age in Years" "Years of marriage" Cheers Petr > -Original Message- > From: R-help On Behalf Of Steven Yen

Re: [R] Variable labels

2021-05-14 Thread Steven Yen
get? Use save/load. You want to do something different? So please explain what exactly. Cheers Petr -Original Message- From: Steven Yen Sent: Thursday, May 13, 2021 5:53 PM To: PIKAL Petr Subject: Re: [R] Variable labels Petr Those attachments (1.jpg, 2.jpg) I sent earlier were just

Re: [R] Variable labels

2021-05-14 Thread Jim Lemon
;? You can > use attr. > You want to make binary file which behaves like the one you get? Use > save/load. > You want to do something different? So please explain what exactly. > > Cheers > Petr > > > > -----Original Message- > > From: Steven Yen > >

Re: [R] Variable labels

2021-05-13 Thread PIKAL Petr
M > To: PIKAL Petr > Subject: Re: [R] Variable labels > > Petr > > Those attachments (1.jpg, 2.jpg) I sent earlier were just screen captures > (with a third-party program) of what I saw in the Environment pane right > after loading the data. Sorry I cannot explain my

Re: [R] Variable labels

2021-05-13 Thread PIKAL Petr
t ordinary vector" > attr(vec.m, "some") [1] "some specialvector" "another special vector" "just ordinary vector" > Cheers Petr > -Original Message- > From: R-help On Behalf Of Steven Yen > Sent: Thursday, May 13, 2021 10:0

Re: [R] Variable labels

2021-05-13 Thread Steven Yen
Thanks. What I need “appears” simple. The .RData file is provided by a third party (likely converted from a different data format such as SAS in which variable labels (not value labels) are common). When I load the binary file, in the “environment” I see, as expected, a data frame showing how ma

Re: [R] Variable labels

2021-05-12 Thread Fredrik Karlsson
Hi, I am sorry but I don't understand your question, Generally, "clicking" is not something you can assume to be implemented for anything in R. However, if you read the manual for the package https://gdemin.github.io/expss/ you get an example at the bottom where an illustration of how the packa

[R] Variable labels

2021-05-12 Thread Steven Yen
I insert variable with the expss function as shown below. No error message. My question is, how to save the variable labels in the data frame so that I can click to read the labels. Thank you. mydata<-read_excel("data/Excel/hseinv.xlsx",na=".") library(expss) mydata=apply_labels(mydata,    

Re: [R] variable in annotation, ggplot2

2019-12-16 Thread Troels Ring
Thanks a lot for the interesting possibilities - R is wonderful! BW Troels -Oprindelig meddelelse- Fra: Rui Barradas Sendt: 16. december 2019 19:31 Til: Troels Ring ; r-help mailing list Emne: Re: [R] variable in annotation, ggplot2 Another way: expr <- substitute(V == x, lis

Re: [R] variable in annotation, ggplot2

2019-12-16 Thread Rui Barradas
Another way: expr <- substitute(V == x, list(x = as.list(V))) ggplot(df, aes(x, y)) + geom_line() + annotate("text", x = 3, y = 20, label = deparse(expr), parse = TRUE) Or this one (nothing to do with your use case, it's an example of plotmath): v <- paste("atop(", paste0("'V ='*a

Re: [R] variable in annotation, ggplot2

2019-12-16 Thread Rui Barradas
Hello, If you form the label with paste before the plot, it can display both values. Something like lab <- paste("V = ", paste(V, collapse = ",")) ggplot(df,aes(x=x,y=y)) + geom_line() + annotate("text", x = 3, y = 20, label = lab) Hope this helps, Rui Barradas Às 14:55 de 16/12/19, Tr

[R] variable in annotation, ggplot2

2019-12-16 Thread Troels Ring
Hi friends - I have a simple problem of inserting values in label of a ggplot2. I have a vector V with two values and want to show them in the plot. Here is what I tried - at most get the first entry "28". R version 3.6.1 (2019-07-05) Windows 10 BW Troels library(ggplot2) x <- 1:5 y <

Re: [R] Variable centring within "predict.coxph"

2018-03-02 Thread Eric Berger
Hi Laura, I will state up front that I have no experience or knowledge of the Cox model or the survival package. Out of curiosity I loaded the package and did ?coxph and found the following comment in the documentation: "The routine internally scales and centers data to avoid overflow in the argum

[R] Variable centring within "predict.coxph"

2018-03-02 Thread Bonnett, Laura
Dear R-help, I am using R-3.3.2 on Windows 10. I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for use in R too (as I far prefer R

Re: [R] variable names in lm formula ~.

2018-01-31 Thread Ista Zahn
I poked at this a little bit and found that the issue exists in stats:::C_termsform (which is called by terms.formula). Here is a variation on the demonstrations provided by Vito and Bert earlier: d<-data.frame(y=rnorm(10,5,.5), age=rnorm(10), exp=rnorm(10),

Re: [R] variable names in lm formula ~.

2018-01-30 Thread Bert Gunter
Well... ?terms.formula says: "data: a data frame from which the meaning of the special symbol . can be inferred. It is unused if there is no . in the formula." So this seems to me to be an obscure bug, as I have found no warning against this admittedly confusing but still, I think, legal syntax.

Re: [R] variable names in lm formula ~.

2018-01-30 Thread Jeff Newmiller
Functions are first class objects, so some kind of collision is bound to happen if you do this... so don't. -- Sent from my phone. Please excuse my brevity. On January 30, 2018 3:11:56 AM PST, "Vito M. R. Muggeo" wrote: >dear all, >Is the following intentional? Am I missing anything in docume

[R] variable names in lm formula ~.

2018-01-30 Thread Vito M. R. Muggeo
dear all, Is the following intentional? Am I missing anything in documentation? d<-data.frame(y=rnorm(10,5,.5),exp=rnorm(10), age=rnorm(10)) formula(lm(exp(y)~exp+age, data=d)) #--> exp(y) ~ exp + age formula(lm(exp(y)~., data=d)) #--> exp(y) ~ age variable 'exp' (maybe indicating "experience")

[R] Variable selection in clusters using 1-R2 ratio

2017-10-27 Thread Seeliger, Curt
Folks, I am looking for a means for calculating the 1-R^2 ratio for variable selection to mimic the values of PROC VARCLUS in SAS. While there may be better methods for variable selection, we are trying to duplicate published results at this time. To date, I have been unable to find a way to o

Re: [R] variable scale and transform confusion with glmm

2017-05-13 Thread Bert Gunter
This list is about R programming not statistics, so your post is OT. Try stats.stackexchange.com instead. However, given your admitted statistical ignorance, I think you need a local consultant to lead you through the statistical wilderness, not a remote internet list. Note that, e.g. "which base"

[R] variable scale and transform confusion with glmm

2017-05-13 Thread Sharada Ramadass
Hello, I am a complete newbie to GLMM and R. I do understand some bit of statistics though I am in no-way a core statistician. So, here are my doubts and I would really appreciate if someone can provide some inputs. I have looked up for prior responses on various lists and could not come up with

Re: [R] Variable

2016-11-24 Thread David Winsemius
> On Nov 24, 2016, at 8:50 PM, Val wrote: > > Hi all, > > I am trying to get shell variable(s) into my R script in Linux . How > do I get them? > > my shell script is > t1.sh > #!bin/bash > Name=Alex; export Name > Age=25; export Age > > > How do get the Name and Age variables i

Re: [R] Variable

2016-11-24 Thread Jeff Newmiller
?commandArgs -- Sent from my phone. Please excuse my brevity. On November 24, 2016 8:50:29 PM PST, Val wrote: >Hi all, > >I am trying to get shell variable(s) into my R script in Linux . How >do I get them? > >my shell script is >t1.sh > #!bin/bash > Name=Alex; export Name > Age=25;

[R] Variable

2016-11-24 Thread Val
Hi all, I am trying to get shell variable(s) into my R script in Linux . How do I get them? my shell script is t1.sh #!bin/bash Name=Alex; export Name Age=25; export Age How do get the Name and Age variables in my R script? My R script is test.R print " Your Name is $Name and

[R] variable selection problem

2016-11-23 Thread Anderson Eduardo
Hello I am trying to run vignette example for the MaxentVariableSelection package, but something wrong is happening. I can't figure out. Here is the code: maxentPath = ("/home/anderson/R/x86_6

Re: [R] Variable 'A' is not a factor Error message

2016-11-16 Thread S Ellison
Ellison > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of ahmed > meftah > Sent: 11 November 2016 17:52 > To: r-help@r-project.org > Subject: [R] Variable 'A' is not a factor Error message > > I am running a DOE with

[R] Variable 'A' is not a factor Error message

2016-11-12 Thread ahmed meftah
I am running a DOE with the following code library(Rcmdr) library(RcmdrMisc) library(RcmdrPlugin.DoE) # Define plackett burman experiment PB.DOE <- pb(nruns= 12 ,n12.taguchi= FALSE ,nfactors= 12 -1, ncenter= 0 , replications= 1 ,repeat.only= FALSE ,randomize= TRUE ,se

Re: [R] Variable String formation

2016-09-22 Thread David Winsemius
> On Sep 22, 2016, at 8:01 AM, Roy Mendelssohn - NOAA Federal > wrote: > > Hi All: > > I am trying to write code to create a string to be executed as a command. > The string will be of the form: > > "param <- param[,rev(seq_len(dataYLen)),,drop = FALSE]" > > Now just creating that string i

[R] Variable String formation

2016-09-22 Thread Roy Mendelssohn - NOAA Federal
Hi All: I am trying to write code to create a string to be executed as a command. The string will be of the form: "param <- param[,rev(seq_len(dataYLen)),,drop = FALSE]" Now just creating that string is simple enough. Where the problem arises is the array param could be 2, 3, or 4 dimensions

Re: [R] Variable labels and value labels

2016-06-01 Thread Jim Lemon
80+")) age value.labels(age) Jim On Thu, Jun 2, 2016 at 3:37 AM, wrote: > Hi Jim, > > many thanks for the hint. > > When looking at the documentation I did not get how I do control which > value gets which label. Is it possible to define it? > > Kind regards > &

Re: [R] Variable labels and value labels

2016-05-31 Thread Jim Lemon
Hi Georg, You may find the "add.value.labels" function in the prettyR package useful. Jim On Tue, May 31, 2016 at 10:00 PM, wrote: > Hi All, > > I am using R for social sciences. In this field I am used to use short > variable names like "q1" for question 1, "q2" for question 2 and so on and >

Re: [R] Variable labels and value labels

2016-05-31 Thread Bert Gunter
I am not sure this is relevant or helpful, but see ?abbreviate, which one can use to abbreviate long strings as labels (but only for English-like languages, I believe). -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Op

Re: [R] Variable labels and value labels

2016-05-31 Thread PIKAL Petr
Hi see in line > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of > g.maub...@weinwolf.de > Sent: Tuesday, May 31, 2016 2:01 PM > To: r-help@r-project.org > Subject: [R] Variable labels and value labels > > Hi All, > > I

[R] Variable labels and value labels

2016-05-31 Thread G . Maubach
Hi All, I am using R for social sciences. In this field I am used to use short variable names like "q1" for question 1, "q2" for question 2 and so on and label the variables like q1 : "Please tell us your age" or q2 : "Could you state us your household income?" or something similar indicating w

Re: [R] variable selection using residual difference

2016-03-19 Thread Bert Gunter
Suggestion: Don't do this! I suggest that you consult with a local statistician or post to a statistical website like stats.stackexchange.com for what might be sensible procedures for variable selection (a complex and controversial topic!) and why what you propose is or is not a good idea (don't

[R] variable selection using residual difference

2016-03-19 Thread Hassan, Nazatulshima
I have the following example dataset set.seed(2001) n <- 100 Y <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) X1 <- sample(x=c(0,1,2), size

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

[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] Variable Selection for Logistic Regression

2015-12-17 Thread Christiaan Pauw
Lasso is an obvious choice by it may also be interesting to look at the variable importance from a random forest model On 17 Dec 2015 17:28, "Manish MAHESHWARI" wrote: > Hi, > > I have a dataset with approx 400K Rows and 900 columns with a single > dependent variable of 0/1 flag. The independent

[R] Variable Selection for Logistic Regression

2015-12-17 Thread Manish MAHESHWARI
Hi, I have a dataset with approx 400K Rows and 900 columns with a single dependent variable of 0/1 flag. The independent variables are both categorical and numerical. I have looked as SO/Cross Validated Posts but couldn't get an answer for this. Since I cannot try all possible combinations of

Re: [R] Variable names conflict

2015-10-15 Thread Jeff Newmiller
My strategy is to be specific about the names of columns at the top level. As I see it, letting functions internally come up with their own column names makes fragile code. foo <- function(df, newColName ) { x <- setNames( df[, 1, drop = FALSE], newColName ) dfOut <- data.frame(df, x) dfOut }

Re: [R] Variable names conflict

2015-10-15 Thread Adams, Jean
Axel, The solution you propose looks fine to me, if an error is the outcome that you want in such a situation. Were you hoping for a different outcome? Would you, for example, prefer that the "x" in the data frame be given a different name, rather than the "x" in the function? Jean On Thu, Oct

Re: [R] Variable names conflict

2015-10-15 Thread Giorgio Garziano
May this be fine ? foo <- function(df) { x <- df[, 1, drop = FALSE] available <- rev(letters[(letters %in% colnames(df)) == FALSE]) colnames(x) <- available[1] dfOut <- data.frame(df, x) dfOut } Data <- data.frame(x = c(1, 2), y = c(3, 4)) foo(Data) x y z 1 1 3 1 2 2 4 2 -- GG

[R] Variable names conflict

2015-10-15 Thread Axel Urbiz
Hello, I have a variable named 'x' defined inside a function, which may conflict with a variable name supplied in the argument to the function. What is the best practice to avoid this conflict? foo <- function(df) { x <- df[, 1, drop = FALSE] dfOut <- data.frame(df, x) dfOut } Data <- da

Re: [R] Variable Class "numeric" instead recognized by dplyr as a 'factor'

2015-09-27 Thread Bert Gunter
Yes, but I think of numeric data with non-numeric values (e.g. "." for missing) as character, not numeric. Missing to me means either empty or with the missing value code specified as you describe. Ergo my comment. Your clarification is nevertheless appropriate. Cheers, Bert Bert Gunter "Data is

Re: [R] Variable Class "numeric" instead recognized by dplyr as a 'factor'

2015-09-27 Thread peter dalgaard
> On 27 Sep 2015, at 22:12 , Bert Gunter wrote: > >> >> Due to missing data, R originally classified each X and Y variable as a >> ‘factor’, subsequently changed to ‘numeric’ via ‘as.numeric’ command. > > No. > a) missing data will not cause numeric data to become factor. There's > something

Re: [R] Variable Class "numeric" instead recognized by dplyr as a 'factor'

2015-09-27 Thread Bert Gunter
I believe you need to spend some time with an R tutorial, as I don't believe what you understand what factors are and how they should be used."Dummy variables" are also almost certainly unnecessary and usually undesirable, as well. A few comments below may help.. Cheers, Bert Bert Gunter "Data

Re: [R] Variable Class "numeric" instead recognized by dplyr as a 'factor'

2015-09-27 Thread Thierry Onkelinx
I doubt that dplyr is the problem. have a look at the output of str(CSUdata2) The problem is probably in there. Sending a reproducible example of the problem makes it easier for us to help you. Note that this list doesn't accept HTML mail. I suggest that you read the posting guide carefully. ir.

[R] Variable Class "numeric" instead recognized by dplyr as a 'factor'

2015-09-27 Thread james.vordtriede
Hi--I’m new to R. For a dissertation, my panel data is for 48 Sub-Saharan countries (cross-sectional index=’i’) over 55 years 1960-2014 (time-series index=’t’). The variables read into R from a text file are levels data. The 2SLS regression due to reverse causality will be based on change in

Re: [R] variable selections to avoid multicollinearity

2015-05-17 Thread Bert Gunter
OFFTOPIC! This is a statistical question, not an R question. Post on a statistics site like stats.stackexchange.com . However, your post suggests that you are completely out of your depth here (0/1 responses suggest that glm modeling via logistic regression is called for). Remote internet advice

[R] variable selections to avoid multicollinearity

2015-05-17 Thread Kristi Glover
HI R user, I was trying to reduce my independent variables before I run models. I have a dependent variable as a present or TRUE only (no Absence or False) whereas I have more than 20 independent variables but they are highly correlated. I was trying to reduce the independent variables . I foun

Re: [R] Variable number of loops

2015-05-16 Thread Jim Lemon
Hi all, Given the number of help requests that involve permutations/combinations, and the less than obvious naming of the expand.grid function, perhaps adding an alias such as "permute.elements" or "combine.elements" might ease the tasks of both searchers and those offering help. Neither of the abo

Re: [R] Variable number of loops

2015-05-16 Thread Bert Gunter
1. Please always reply to the list unless there is a compelling reason to keep the discussion private. You will have a better chance of getting something useful that way. 2. I don't know what you mean by "I don't have a fixed number of variables." You have to specify at least the number of variabl

Re: [R] Variable number of loops

2015-05-16 Thread Bert Gunter
Are you trying to reinvent ?expand.grid ? -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Fri, May 15, 2015 at 1:40 PM, WRAY NICHOLAS wrote: > I am tryi

[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 l

Re: [R] Variable Column Names and Lists

2015-02-27 Thread Brian Trautman
This worked perfectly, thank you! On Fri, Feb 27, 2015 at 10:47 AM, Duncan Murdoch wrote: > On 27/02/2015 1:18 PM, Brian Trautman wrote: > > This should be a simple question, but I am at my wits end. > > > > dt<-data.table(a=rep(1:10, 26), b=1:260, c=rep(1:2, 130)) > > > > sumvar <- 'mysum' > >

Re: [R] Variable Column Names and Lists

2015-02-27 Thread Duncan Murdoch
On 27/02/2015 1:18 PM, Brian Trautman wrote: > This should be a simple question, but I am at my wits end. > > dt<-data.table(a=rep(1:10, 26), b=1:260, c=rep(1:2, 130)) > > sumvar <- 'mysum' > bvar <- 'b' > > dt_min <- dt[, list(sumvar = sum(get(bvar))), by=list(a)] > print(dt_min) > > I want th

[R] Variable Column Names and Lists

2015-02-27 Thread Brian Trautman
This should be a simple question, but I am at my wits end. dt<-data.table(a=rep(1:10, 26), b=1:260, c=rep(1:2, 130)) sumvar <- 'mysum' bvar <- 'b' dt_min <- dt[, list(sumvar = sum(get(bvar))), by=list(a)] print(dt_min) I want the function to return two variables, "a" and "mysum". However, it i

Re: [R] Variable Length Differ

2014-11-02 Thread Jeff Newmiller
This is not reproducible (see for example [1]), so it is very difficult to know exactly what the problem is. Also, you need to post on this list using the plain text format option in your email software, since the HTML format you used can mess up your code. I can say that using "[" indexing on

[R] Variable Length Differ

2014-11-02 Thread TJUN KIAT TEO
This is my code BSUPred<-(forecast(BSU,h=h)[[2]]) PressurePred<-(forecast(Pressure,h=h)[[2]]) Placer<-(rep(1,h)) test<-as.data.frame(cbind(BSUPred,PressurePred)) test$Placer<-rep(1:2,h/12) test$Placer<-i test<-as.data.frame((test[c("Placer","BSUPred","PressurePred")]))

Re: [R] Variable selection from given data

2014-10-30 Thread David Winsemius
Untested and with the presumption that you have the appropriate package loaded: sapply(1:15, function(x) qr(y ~ ., df[-grep(paste0(“x”,i)]) ) > On Oct 30, 2014, at 11:14 PM, Preetam Pal wrote: > > Hi, > > I am doing quantile regression of y on a set of 15 explanatory variables x1, > x2,x

[R] Variable selection from given data

2014-10-30 Thread Preetam Pal
Hi, I am doing quantile regression of y on a set of 15 explanatory variables x1, x2,x15. I want to run 15 regression models where in the i-th model, y would be regressed on all x variables except x-i. Then I would compare the results. At this point, I donot know how to create the 15 data se

Re: [R] variable length lisin in data frame

2014-05-12 Thread MacQueen, Don
I think it will depend on how you plan to use the data. Again in my opinion, I think the simplest most natural storage structure in the context of R would be a nested list: mydat <- list( list(contacts=c(3,4), ncon=2), list(contacts=c(1,3,4), ncon=3), list(contacts=c(4,2,1), ncon=3), list(

Re: [R] variable length lisin in data frame

2014-05-10 Thread William Dunlap
> d <- data.frame(id=1:4, no.contacts=c(2,3,3,1)) > d$contacts_list <- list(3:4, c(1,3,4), c(4,2,1), 1 ) If you store that information in a longer format, with each row being an edge to the relationship graph, it can make further processing easier: d2 <- with(d, data.frame(id=rep(id, vappl

Re: [R] variable length lisin in data frame

2014-05-10 Thread arun
Hi, Try:  dat <- data.frame(id=1:4, contacts_list=I(list(3:4,c(1,3,4), c(4,2,1), 1)), `number of contacts`=c(2,3,3,1),check.names=FALSE) attr(dat$contacts_list,"class") <- NULL #if needed  dat A.K. Dear Group, I have data like the following id   contacts_list   number of contacts

Re: [R] variable length lisin in data frame

2014-05-10 Thread Duncan Murdoch
On 10/05/2014, 7:46 AM, Ragia Ibrahim wrote: Dear Group, I have data like the following id contacts_list number of contacts --- 1 3 4 2 2 1 3 43 34 2 1

[R] variable length lisin in data frame

2014-05-10 Thread Ragia Ibrahim
Dear Group, I have data like the following id contacts_list number of contacts --- 1 3 4 2 2 1 3 43 34 2 1 3 411 -

Re: [R] Variable names in plotCI

2014-04-11 Thread Jim Lemon
On 04/11/2014 07:59 PM, MÂȘ Teresa Martinez Soriano wrote: Hello to everyone, I would like to put the variable names in the x-axis of this plot instead of number 1:63: plotCI(1:num_col_comp,med,2.06*des/sqrt(n),lwd=1,col="red",scol="seashell4",main="Intervalo de confianza",xlab="Variables clĂ­n

Re: [R] Variable names in plotCI

2014-04-11 Thread Pascal Oettli
Hello, When posting, you are asked to provide a reproducible code (including packages you are using) and to not post in HTML. The following might help: library(plotrix) y<-runif(10) err<-runif(10) plotCI(1:10,y,err,main="Basic plotCI",xaxt='n',xlab='') axis(1,1:10,LETTERS[1:10]) Regards, Pascal

[R] Variable names in plotCI

2014-04-11 Thread MÂȘ Teresa Martinez Soriano
Hello to everyone, I would like to put the variable names in the x-axis of this plot instead of number 1:63: plotCI(1:num_col_comp,med,2.06*des/sqrt(n),lwd=1,col="red",scol="seashell4",main="Intervalo de confianza",xlab="Variables clĂ­nicas",ylab="Intervalo de confianza")abline(h=0, col="yello

Re: [R] Variable importance - ANN

2013-12-04 Thread Max Kuhn
If you are using the nnet package, the caret package has a variable importance method based on Gevrey, M., Dimopoulos, I., & Lek, S. (2003). Review and comparison of methods to study the contribution of variables in artificial neural network models. Ecological Modelling, 160(3), 249-264. It is base

Re: [R] Variable importance - ANN

2013-12-04 Thread Liaw, Andy
...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giulia Di Lauro Sent: Wednesday, December 04, 2013 6:42 AM To: r-help@r-project.org Subject: [R] Variable importance - ANN Hi everybody, I created a neural network for a regression analysis with package ANN, but now I need to know

[R] Variable importance - ANN

2013-12-04 Thread Giulia Di Lauro
Hi everybody, I created a neural network for a regression analysis with package ANN, but now I need to know which is the significance of each predictor variable in explaining the dependent variable. I thought to analyze the weight, but I don't know how to do it. Thanks in advance, Giulia Di Lauro.

Re: [R] variable standardization in manova() call

2013-11-16 Thread Sergio Fonda
thank you for your reply. However, your remark was not so clear to me so I attach a short script I tried to launch. The comparison between results got from MANOVA() call with the non-standardized and standardized version of the same data frame, convinced me that it is not necessary to standardize

Re: [R] variable standardization in manova() call

2013-11-07 Thread Sergio Fonda
2013/11/6 Michael Friendly : > On 11/4/2013 10:45 AM, Sergio Fonda wrote: >> >> Hi, >> I'm not able to get information about the following question: >> >> is the variables standardization a default option in manova() (stats >> package)? >> Or if you want to compare variables with different units or

Re: [R] variable standardization in manova() call

2013-11-06 Thread Michael Friendly
On 11/4/2013 10:45 AM, Sergio Fonda wrote: Hi, I'm not able to get information about the following question: is the variables standardization a default option in manova() (stats package)? Or if you want to compare variables with different units or scales and rather different variances, you have

[R] variable standardization in manova() call

2013-11-04 Thread Sergio Fonda
Hi, I'm not able to get information about the following question: is the variables standardization a default option in manova() (stats package)? Or if you want to compare variables with different units or scales and rather different variances, you have to previously standardize the variables ? Th

[R] Variable operations

2013-10-23 Thread Syamsul Rizal
Dear All: I have v = c(xy, xy^2, z) dotv = sum(v*v) I hope, I have the following result: dotv = x^2*y^2 + x^2*y^4 + z^2 (still in variable x, y and z, not numeric result) How to make simple script, so that I have: dotv = x^2*y^2 + x^2*y^4 + z^2 Thanks a lot for your help. Best regards, Riz

Re: [R] Variable panel sizes in box plot

2013-08-04 Thread Aziz, Muhammad Fayez
: Sunday, August 04, 2013 5:43 PM To: Aziz, Muhammad Fayez Cc: r-help@r-project.org Subject: Re: [R] Variable panel sizes in box plot On 08/05/2013 08:01 AM, Aziz, Muhammad Fayez wrote: > > Hi, > > My question is how to make panel sizes variable in box plots. I mean if a > panel h

  1   2   3   4   5   >