similar to: create multiple categorical variables in a data frame using a loop

Displaying 20 results from an estimated 200 matches similar to: "create multiple categorical variables in a data frame using a loop"

2018 Apr 20
1
create multiple categorical variables in a data frame using a loop
> On Apr 19, 2018, at 1:22 PM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun <ycding at coh.org> wrote: >> >> Hi All, >> >> I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno (a data frame) based on log2pfoa values. I can do it using the following code.
2018 Apr 19
0
create multiple categorical variables in a data frame using a loop
> On Apr 19, 2018, at 11:20 AM, Ding, Yuan Chun <ycding at coh.org> wrote: > > Hi All, > > I want to create a categorical variable, cat.pfoa, in the file of pfas.pheno (a data frame) based on log2pfoa values. I can do it using the following code. > > pfas.pheno <-within(pfas.pheno, {cat.pfoa<-NA > cat.pfoa[pfas.pheno$log2pfoa
2018 Apr 19
0
create multiple categorical variables in a data frame using a loop
Hello, When programming it is better to use dat[["variable"]] than dat$variable. So your code could be pfas.pheno[[cat.var]] <- NA pfas.pheno[[cat.var]][pfas.pheno[,i] <= quantile(pfas.pheno[,i],0.25, na.rm =T)] <- 0 etc. Untested. Hope this helps, Rui Barradas On 4/19/2018 7:20 PM, Ding, Yuan Chun wrote: > Hi All, > > I want to create a categorical variable,
2006 Sep 25
2
paste? 'cmd /c "c:\\pheno\\whap --file c:\\pheno\\smri --alt 1"'
Dear R users, This command works (calling a programm -called whap- with file specifiers etc.): >system('cmd /c "c:\\pheno\\whap --file c:\\pheno\\smri --alt 1 --perm 500"', intern=TRUE) Now I need to call it from a loop to replace the "1" by different number, however I get lost using the quotes: I tried numerous versions of: >i<-1
2010 Sep 24
1
color of lines while printing through for loop
I am trying to find a convenient way to control line colors when printing from a for loop using the lines command. Right now I have solved this by creating a colors vector that is refered to in the loop with index. However, the colors choosen here are just 1,2,3,4,5... I would like to get colors from the col = rainbow(x) that you can use in plot() and set the to be my number of lines (I think
2010 May 06
5
Apologies : question on transforming a table
Dear R-help list, Apologies. I am trying to convert one table to another. It feels that it should be a very straightforward answer with a single (or two) commands with the right extensions, but I really can't figure this out right now. I have several hundred pheno factors actually, so manually doing this line by line is not an option. My original table is approximately like this : ID
2011 Aug 30
2
Error in evalauating a function
Hi, ? I am very new to R. So, pardon my dumb question. I was trying to write my own function to run a different model (perform an ordered logistic regression) using the example in website http://pngu.mgh.harvard.edu/~purcell/plink/rfunc.shtml But R returns a error `R Error in eval(expr, envir, enclos) : object 's' not found' when I run it. What am I doing wrong here? Here's
2008 May 13
1
R help: problems with step function
Dear List Members, I have encountered two problems when using the step function to select models. To better illustrate the problems, attached is an R image which includes the objects needed to run the code attached. lm.data.frame have factor variables with 3 levels. The following run shows the first problem. AICs (* and **) are different. I noticed that the Df for rs13482096:rs13483699 is 4,
2008 Feb 01
2
pheno package (PR#10674)
Full_Name: Anja Eggert Version: 2.4.1 OS: Submission from: (NULL) (139.30.70.203) I want to install the pheno package. This is not working. What can I do? Thank you very much, Anja
2011 Dec 08
1
Ultra Xfinity 1500VA UPS
>>>>>>>>>>>>>>><<<<<<<<<<<<<<<< Pheno-Mint upsmon # /sbin/upsdrvctl start Network UPS Tools - UPS driver controller 2.6.1 Network UPS Tools - Generic HID driver 0.35 (2.6.1) USB communication driver 0.31 This PowerCOM device (0d9f:0004) is not (or perhaps not yet) supported by usbhid-ups. Please make sure
2023 Mar 30
1
seqMK function
Hello does anyone know how to set the confidence level within the seqMK() function in the pheno package. It seems to be set automatically at 0.05 and there seems to be neither an input function to set a different level, as there are with some changepoint functions, nor an output to give one the p-value of the changepoint identification which you get with functions ie func$p_value etc ... Thanks
2003 Sep 24
1
64-bit Oracle interface
Hi, I am running the 64bit version of R on a AIX RS6000 cluster on which is also running the ' SQL*Plus: Release 9.2.0.2.0' in the 'ORACLE-environment Version 64 bit AIX 5.1'. I have problems setting up an Oralce database connection. I can instantiate a driver using drv <- Oracle(). But when I try to connect to my database using dbConnect (dbConnect(drv,
2011 May 04
1
merging multiple columns from two dataframes
Hello, I have data in a dataframe with 139104 rows which is multiple of 96x1449. i have a phenotype file which contains the phenotype information for the 96 samples. the snp name is repeated 1449X96 samples. I haveto merge the two dataframes based on sid and sen. this is how my two dataframes look like dat<-data.frame(snpname=rep(letters[1:12],12),sid=rep(1:12,each=12),
2023 Apr 01
1
weird things in seqMK() and sqmk()
Hello The other say I posted a question about altering confidence limits in the seqMK() function in the pheno package. I didn't get any bites but in any case I've been trying to use this function. It seems to me to give very odd results - sometimes identifying 8 or 9 changepoints in a relatively short vector of maybe 40 elements, and at other times not giving any changepoints at all,
2010 Mar 04
6
help
Hi all , I have one query. i have list of some .cel files. in my program i have to mention the path of these .cel files part of my program is, rna.data<-exprs(justRMA(filenames=file.names, celfile.path=*datadir*, sampleNames=sample.names, phenoData=pheno.data, cdfname=cleancdfname(hg18_Affymetrix U133A))) in the place of "datadir" i have to mention the character string of the
2009 Oct 12
2
R commander.
i have two RData files,,i want to print them to check the format of the tables in these files,,,i can load both the files and can read it as well > load('ann.RData') > str(ann) List of 4 $ Name : chr [1:561466] "rs3094315" "rs12562034" "rs3934834" "rs9442372" ... $ Position : int [1:561466] 742429 758311 995669 1008567 1011278 1011521
2010 Apr 29
1
R CMD check Error after R CMD build for R-2.11.0
Dear UseR, I get an error when I run "R CMD check" on my .tar.gz file package, and I don't understand why since I don't obtain any error with "R CMD check" on the package directory. Do you have any idea ? $ sudo ./R-2.11.0/bin/R CMD check eqtl_1.1.tar.gz and $ sudo ./R-2.11.0/bin/R CMD --check-subdirs=no eqtl_1.1.tar.gz return an Error * checking for working
2005 Jun 24
5
Memory limits using read.table on Windows XP Pro
Hello, When I try: geno <-read.table("2500.geno.tab",header=TRUE,sep="\t",na.strings=".",quote=" ",comment.char="",colClasses=c("factor"),nrows=2501) I get, after hour(s) of work: Error: cannot allocate vector of size 9 Kb I have: Rgui.exe --max-mem-size=3Gb and multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
2010 Feb 23
1
GenABEL - problems with load.gwaa.data
Hi all! I am using GenABEL on R for GWAS analysis. I am having a couple of issues: First, I am having a problem reading files (.map, & .ped, size 900Mb, using windows 32-bit) onto R in the "convert.snp.ped" statement. I am thinking this problem is likely due to the large size of the files & my version of R is not able to handle them, since I can read in smaller files.
2007 May 28
1
Where to find "nprq"?
Hi I am trying to install the package "pheno", but it needs the package "nprq" by Roger Koenker et al. which I can I find this package? It does not seem to be on CRAN and googling also doesn't give me an URL - is it still somewhere available? Thanks, Rainer -- NEW EMAIL ADDRESS AND ADDRESS: Rainer.Krug at uct.ac.za RKrug at sun.ac.za WILL BE DISCONTINUED END OF