similar to: conditionals with String variables

Displaying 20 results from an estimated 10000 matches similar to: "conditionals with String variables"

2018 Jan 14
0
consolidate three function into one
Hi Bert, Thank you, yes, you are right. I want to consolidate the three functions into one functions by adding more arguments, adding flexibility to accommodate the number of clusters or the number of Kaplan Meier curves generated in one figure. So, I just need to define one function. Thanks, Ding From: Bert Gunter [mailto:bgunter.4567 at gmail.com] Sent: Sunday, January 14, 2018 9:50 AM
2018 May 11
0
add one variable to a data frame
Sarah's solutions are good, and here's another, even more basic: tmp1 <- unique(dat1$B) tmp2 <- seq_along(tmp1) dat1$C <- tmp2[ match( dat1$B, tmp1) ] > dat1 N B C 1 1 29_log 1 2 2 29_log 1 3 3 29_log 1 4 4 27_cat 2 5 5 27_cat 2 6 6 1_log 3 7 7 1_log 3 8 8 1_log 3 9 9 1_log 3 10 10 1_log 3 11 11 3_cat 4 12 12 3_cat 4 As a single line
2018 May 11
3
add one variable to a data frame
Hi Sarah, Thank you so much!! I got your good ideas. Ding -----Original Message----- From: Sarah Goslee [mailto:sarah.goslee at gmail.com] Sent: Friday, May 11, 2018 11:40 AM To: Ding, Yuan Chun Cc: r-help mailing list Subject: Re: [R] add one variable to a data frame [Attention: This email came from an external source. Do not open attachments or click on links from unknown senders or
2012 Jan 24
0
Problem training a neural network with "neuralnet" library
Hi, I am having difficulty in training a neural network using the package "neuralnet". My neural network has 2 input neurons (covariates), 1 hidden layer with 2 hidden neurons and 2 output neurons (responses). I am training my neural network with a dataset that has been transformed so that each column is of type "numeric". The difficulty I am facing is that the responses of
2018 Jan 14
0
consolidate three function into one
FAQ 7.22 You must print a ggplot object, for example with print(m52.2cluster) For the FAQ, run the line system.file("../../doc/FAQ") in R on your computer. Open up the resulting filepath in your favorite editor and scroll down to 7.22 On Sun, Jan 14, 2018 at 4:21 PM, Ding, Yuan Chun <ycding at coh.org> wrote: > Hi Bert, > > I am sorry to bother you on weekend. >
2018 Jan 14
0
consolidate three function into one
HI R users, I construct dendrogram tree and cut the tree into different clusters, then generate survival curves by the following three functions. All variables are included in an inputfile. Can you help me to consolidate the following three function into one functions? I thought about using if else function, but not sure how to do it. Thank you, Ding # function to generate RFS RFS2cluster
2018 Feb 10
1
please help me a little
Hi R Users, I am very frustrated with the following code. Please do me a favor to run it. after reading into the test data set (I also pasted the data set below), the first line of code for "res_coxphf" did not work and generated the error code below. but the other three line worked well. the second line for "res_coxphf2" should be the same as the first line; I need to run
2018 Jan 14
2
consolidate three function into one
Hi Bert, I am sorry to bother you on weekend. I am still struggling on defining a correct function. I first defined the function RFS (see below), then run it by provide the two argument. m52.2cluster <-RFS(inputfile =allinfo_m52, N=2 ) I do not get error message, but no figure displays on screen. I do not know what is going on. Can you help me a little more on this issue? Thank you,
2018 Jan 15
0
consolidate three function into one
That is certainly OK, but you can also just use print(ggsurvplot(...)) as your final statement. out <- RFS( ...) would then return the ggsurvplot object *and* graph it. Any good R tutorial or a web search will provide more details on function returns, which you might find useful. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and
2018 Jan 15
1
consolidate three function into one
Thank you, your suggestion is simpler and logically better. I had impression that the last object in a function gets returned, so I did not add the print function at the bottom line of the function definition. Returning an object and graph the object are different process, I am a beginner for writing R function and need to find a good guide source about writing R functions. If you know a good
2018 Jan 15
2
consolidate three function into one
Hi Richard, Thank you so much!! I understand the problem now, I assign a name to the "ggsurvplot" object and then add print(fig) at bottom of function definition, now figure gets printed on screen. Ding # function to generate RFS curves RFS <- function( inputfile, N ) { cluster<- survfit(Surv(RFS_days2, OV_Had_a_Recurrence_CODE) ~ clusters, data =
2018 May 11
0
add one variable to a data frame
Hi, Here's one way to approach it, using the coercion of factor to numeric. Note that I changed your data.frame() statement to avoid coercing strings to factors, just to make it simpler to set the levels. dat1 <-data.frame(N=seq(1, 12,1), B=c("29_log","29_log", "29_log", "27_cat", "27_cat", "1_log", "1_log",
2018 May 11
3
add one variable to a data frame
Hi All, I have a data frame dat1: dat1 <-data.frame(N=seq(1, 12,1), B=c("29_log","29_log", "29_log", "27_cat", "27_cat", "1_log", "1_log", "1_log", "1_log", "1_log",
2007 May 06
1
simple table ordering question
Hi all, I'm sure this is simple but I don't get it. I have a table mytable<-c(rep("Disagree",37),rep("Agree",64)) table(mytable) this gives me Agree Disagree 64 37 but I didn't ask for it to be in alphabetic order. How can I get it in original order? Disagree Agree 37 64 Thanks, Jeff Jeffrey. M. Miller, PhD
2018 Sep 28
2
Bug in conditionals to assign values to variables?
Hi, According to https://wiki2.dovecot.org/Variables you could use conditionals to assign values to a varible. The syntax is: %{if;value1;operator;value2;value-if-true;value-if-false} where any of the fields can refer to another field using %v or %{value} syntax. The problem is that when I use a config like: user_attrs = ...,=relpath=%{if;%u;eq;somevalue;valuetrue;valuefalse} it works
2018 Oct 01
0
Bug in conditionals to assign values to variables?
> On 28 Sep 2018, at 15.25, Angel L. Mateo <amateo at um.es> wrote: > > user_attrs = ...,=relpath=%{if;%{user};eq;somevalue;valuetrue;valuefalse} > > then it reports in logs: > > Sep 28 14:23:22 myotis60 dovecot: auth: Error: var_expand_long(if;%{user}) failed: if: requires four or five parameters, got 1 > > anyway, the variable is correctly initialized, but
2018 Oct 02
1
Bug in conditionals to assign values to variables?
> > I can't seem to be able to reproduce this, not even with v2.2.33. It simply works without logging any errors. > I've made a lot of changes now. I can't neither reproduce it anymore :-(. If I could, I'll send the complete configuration. -- Angel L. Mateo Mart?nez Secci?n de Telem?tica ?rea de Tecnolog?as de la Informaci?n y las Comunicaciones Aplicadas (ATICA)
2018 May 11
2
add one variable to a data frame
Sarah et. al.: As a matter of aesthetics (i.e. my personal ocd-ness) I prefer using the public API of an object, i.e. *not* to makes use of the representation of a factor as essentially an integer vector with labels, but rather to use its documented behavior. (Feel free to ignore this remark!) Anyway, >cumsum(!duplicated(dat1$B)) [1] 1 1 1 2 2 3 3 3 3 3 4 4 will do it. This is very
2010 Jun 16
3
Function argument as string
Hi, Suppose a write a function a_fn<-function(arg1) { return(table(arg1)); } I have a column called AGE. Now I call the function c = a_fn(AGE); When a_fn is called, AGE is received in arg1. My question is, how do I access the actual name of the argument arg1? i.e, inside the function, i need to know that the actual name of arg1 is "AGE" in this case. Thanks in advance,
2003 Aug 08
0
Configuration File
I am using Unix Open Server 5 and have a copy of Samba 1.9.18.p7 running on my Unix server. I am trying to install Samba 2.2.6 and I think I have it installed and configured but when I run "testparm" it looks at the old configuration file for Samba 1.9.18p7 which is located in /usr/local/samba/lib. The Samba 2.2.6 configuration file is located in /usr/lib/samba/lib. How do I get it to