[R] Decompose df1 into another df2 based on values in df1

2021-05-26 Thread Adrian Johnson
Hello, I am trying to convert a df (given below as d1) into df2 (given below as res). I tried using loops for each row. I cannot get it right. Moreover the df is 25 x 500 in dimension and I cannot get it to work. Could anyone help me here please. Thanks. Adrian. d1 <- structure(list(S1 =

Re: [R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
I'll put that in my notes. Thanks! ​Larry Johnson Editor and Publisher Cobb County Courier 404-664-2034 http://cobbcountycourier.com From: Hadley Wickham Sent: Sunday, April 25, 2021 7:14 PM To: Larry Johnson Cc: Duncan Murdoch ; r-help@r-projec

Re: [R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
my drift). I'd still like to know why updating packages in bulk isn't working for me, but I can move ahead for now, and I'll figure out how to fix that later. So thanks Duncan. ​Larry Johnson Editor and Publisher Cobb County Courier 404-664-2034 http://cobbcountycourier.

[R] help finding a starting point to diagnose inability to install or update packages

2021-04-25 Thread Larry Johnson
broom fail with no output. I've been searching for similar reports of failure here in these archives, on the RStudio forums, and on the internet and have found nothing that's a seamless match. If I can't find anything I'll check out filing a bug report (I'

[R] pheatmap - clustering of select columns

2019-03-08 Thread Adrian Johnson
Dear group, In pheatmap, is it possible to cluster select colmns. For example, in a matrix of 10 rows and 20 columns. I want to cluster only those columns 1-10 and cluster rows. Similarly, retaining the same row clustering resulted from clustering of columns 1-10, I want to enforce clustering of 11

[R] faster execution of for loop in Fishers test

2019-02-11 Thread Adrian Johnson
Dear group, I have two large matrices. Matrix one: is 24776 x 76 (example toy1 dput object given below) Matrix two: is 12913 x 76 (example toy2 dput object given below) Column names of both matrices are identical. My aim is: a. Take each row of toy2 and transform vector into UP (>0) and DN (

Re: [R] (no subject)

2019-02-11 Thread Adrian Johnson
Pardon me, I forgot to add subject line. -Adrian. On Sun, Feb 10, 2019 at 3:49 PM Adrian Johnson wrote: > > Dear group, > > I have two large matrices. > > Matrix one: is 24776 x 76 (example toy1 dput object given below) > > Matrix two: is 12913 x 76 (example toy2

[R] I'm Working On A Data Security Article - Quick Question

2019-02-11 Thread Murris Johnson
Hi, I have a quick question for you about a page on your site that briefly mentions a data security topic, https://stat.ethz.ch/pipermail/r-help/2008-May/162561.html. I plan on writing a few guest authored articles in the next month or so that talk about data security & breaches, are you

[R] (no subject)

2019-02-10 Thread Adrian Johnson
Dear group, I have two large matrices. Matrix one: is 24776 x 76 (example toy1 dput object given below) Matrix two: is 12913 x 76 (example toy2 dput object given below) Column names of both matrices are identical. My aim is: a. Take each row of toy2 and transform vector into UP (>0) and DN (

Re: [R] data transformation

2019-01-20 Thread Adrian Johnson
I apologize, I forgot to mention another key operation. in my matrix -1 to <0 has a different meaning while values between >0 to 1 has a different set of meaning. So If I do logit transformation some of the positives becomes negative (values < 0.5 etc.). In such case, the resulting transformed ma

[R] data transformation

2019-01-20 Thread Adrian Johnson
Dear group, My question, perhaps is more of a statistical question using R I have a data matrix ( 400 x 400 normally distributed) with data points ranging from -1 to +1.. For certain clustering algorithms, I suspect the tight data range is not helping resolving the clusters. Is there a way to tran

[R] lm equivalent of Welch-corrected t-test?

2018-11-13 Thread Paul Johnson
3.576968 sample estimates: mean in group F mean in group M 39.9455843.85358 > (m1.t.effect <- diff(m1.t$estimate)) mean in group M 3.908003 > m1.t.effect/m1.t$statistic mean in group M -0.1668129 -- Paul E. Johnson http://pj.freefaculty.org Director, Center

Re: [R] ANOVA in R

2018-10-10 Thread Paul Johnson
t post hoc comparisons. In car package, Anova function will help. I may teach Anova soon, we'll see if I have better answer then. Paul Johnson University of Kansas On Wed, Oct 10, 2018, 1:14 AM Thanh Tran wrote: > Hi eveyone, > I'm studying about variance (ANOVA) in R and have so

Re: [R] Problems to obtain standardized betas in multiply-imputed data

2018-10-05 Thread Paul Johnson
lm.beta, it actually standardizes variables and runs regression. lm.beta resales coefficients instead. Paul Johnson University of Kansas On Wed, Sep 26, 2018, 5:03 AM CHATTON Anne via R-help wrote: > Dear all, > > I am having problems in obtaining standardized betas on a multiply-imput

[R] looking for formula parser that allows coefficients

2018-08-21 Thread Paul Johnson
quot; = 0.1) I could build a formula from that. That's not too bad. But I still think it would be cool to allow formula input. Have you ever seen it done? pj -- Paul E. Johnson http://pj.freefaculty.org Director, Center for Research Methods and Data Analysis http://

Re: [R] Transforming data for nice output table

2018-08-21 Thread Paul Johnson
__ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. -- Paul E. Johnson

Re: [R] [ESS] M-x R gives no choice of starting dir

2017-12-13 Thread Paul Johnson
e, Switzerland > http://enricoschumann.net > > ______ > ess-h...@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/ess-help -- Paul E. Johnson http://pj.freefaculty.org Director, Center for

[R] function pointers?

2017-11-22 Thread Paul Johnson
fastest possible way. In an Objective-C problem in the olden days, we found the method-lookup was a major slowdown and one of the programmers showed us how to save the lookup and use it over and over. pj -- Paul E. Johnson http://pj.freefaculty.org Director, Center for Research Metho

Re: [R] Issues with 'Miwa' algorithm in mvtnorm package

2017-10-02 Thread Hollie Johnson (PGR)
:13 To: Bert Gunter Cc: r-help@r-project.org; Hollie Johnson (PGR) Subject: Re: [R] Issues with 'Miwa' algorithm in mvtnorm package Hi Hollie, I tried to reproduce your example but could not. Here is what I did. Please explain if you did something different. x <- c(9.358*10^-3, -8.165*

[R] Issues with 'Miwa' algorithm in mvtnorm package

2017-10-02 Thread Hollie Johnson (PGR)
Currently doing some work on local maxima on a random field and have encountered an issue with the Miwa algorithm used with the pmvnorm function in the mvtnorm R package. Based on recommendations by Mi et al., we ran the mvtnorm package using the Miwa algorithm, since we have a maximum of 4 dim

Re: [R] How to get CI from surfit object in survival

2017-08-26 Thread Adrian Johnson
gt; -- Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Sat, Aug 26, 2017 at 5:18 PM, Adrian

Re: [R] How to get CI from surfit object in survival

2017-08-26 Thread Adrian Johnson
hich case you should learn them now; see > ?help -- or have I misunderstood your query? > > Cheers, > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley B

[R] How to get CI from surfit object in survival

2017-08-26 Thread Adrian Johnson
Hi I am not sure hiw to get thr CI from summary function on the survfit object. I can get the percent survival for 2 years from survfit object but I dont get Confidence intervals Could anyone suggest a hint Thanks Adrian [[alternative HTML version deleted]] __

Re: [R] Install package "diagram"

2017-08-17 Thread Paul Johnson
t; __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and > more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/ > posting-guide.html > and provide commented, minima

[R] workaround for "package building problem Centos 7 & R 3.4.1"

2017-08-14 Thread Paul Johnson
er bothered by the problem in the first place. Anyway, we have a workaround, but I don't understand what's wrong to begin with or how to fix it the right way. If you keep Googling, you see that this problem was experienced as early as 2012. It has happened to some of my personal R

Re: [R] Plotting log transformed predicted values from lme

2017-08-12 Thread Paul Johnson
In the rockchalk package, I have a function called newdata that will help with this. Plenty of examples. Probably my predictOmatic function will just work. Motivation is in the vignette. Paul Johnson University of Kansas On Aug 9, 2017 11:23 AM, "Alina Vodonos Zilberg" wrote: >

Re: [R] package building problem Centos 7 & R 3.4.1

2017-08-12 Thread Paul Johnson
On Aug 12, 2017 11:58 AM, "José Abílio Matos" wrote: On Friday, 11 August 2017 22.51.12 WEST Paul Johnson wrote: > Dear everybody: > > Packages that DO pass the package check on my Ubuntu 17.04 laptop with > R 3.4.1 and Mac OSX do not build on Centos 7 with R 3.4.1. I

[R] package building problem Centos 7 & R 3.4.1

2017-08-11 Thread Paul Johnson
uot;/home/pauljohn/R/x86_64-redhat-linux-gnu-library/3.4" [2] "/usr/lib64/R/library" [3] "/usr/share/R/library" The packages in question are all in "/usr/share/R/library". The system-wide R_LIBS_SITE has that directory, Local Variables of /usr/lib64/R/etc/R

[R] test for proportion or concordance

2017-08-03 Thread Adrian Johnson
Hello group, my question is deciding what test would be appropriate for following question. An experiment 'A' yielded 3200 observations of which 431 are significant. Similarly, using same method, another experiment 'B' on a different population yielded 2541 observations of which 260 are significa

Re: [R] Interesting quirk with fractions and rounding

2017-04-22 Thread Paul Johnson
I have to read more books. I studied Golub and van Loan and came away with healthy fear of matrix inversion. But when you look at user contributed regression packages, what do you find? Matrix inversion and lots of X'X. Paul Johnson University of Kansask The key (in your example) is a prope

Re: [R] Interesting quirk with fractions and rounding

2017-04-21 Thread Paul Johnson
owing accidents from trusting floats. I wonder now if all uses of > or < with numeric variables are suspect. Oh well. If everybody posts their advice, I will write a summary. Paul Johnson University of Kansas On Apr 21, 2017 12:02 AM, "PIKAL Petr" wrote: > Hi > >

Re: [R] Peformance question

2017-04-21 Thread Paul Johnson
I dont understand your code. But I do have suggestion. Run the functions in the profiler, maybe differences will point at the enemy. Know what I mean? Rprof('check.out') #run code Rprof(NULL) summaryRprof('check.out') Do that for each method. That may be uninformative. I wondered if you tried t

Re: [R] Prediction plots

2017-04-21 Thread Paul Johnson
I have done this a lot. Would you mind installing my pkg rockchalk and then run example(plotSlope) and example(plotCurve)? If the output is close to what you want, you can adjust my code. The vignette explains. 1. Create newdata object 2. Run that through predict 3. Make plot None of this is rock

[R] Interesting quirk with fractions and rounding

2017-04-20 Thread Paul Johnson
> round(aa) [1] 57 > round(bb) [1] 58 I'm putting this one in my collection of "difficult to understand" numerical calculations. If you have seen this before, I'm sorry to waste your time. pj -- Paul E. Johnson http://pj.freefaculty.org Director, Center for Resea

[R] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Paul Johnson
all successfully. I understand I need something like xvfb to simulate an X11 session, but I don't understand how to make it work. Can one of you give me an idiot's guide on what to do? pj -- Paul E. Johnson http://pj.freefaculty.org Director, Center for Research Methods and Data Analysis ht

[R] tests for significance on conditional inference trees from party package

2016-12-13 Thread Adrian Johnson
Dear group, Please allow me to ask a naive question and pardon if it is qualified as stupid question. I am using party package to classify covariates and predict distribution of survival times for the classified variables. Typically I have a matrix of covariates (columns) including outcome data (o

[R] Clustering methods for data that has bimodal distribution

2016-12-04 Thread Adrian Johnson
Dear group, pardon me for a naive question. I have data matrix (11K rows , 4K columns). The data range is between -1 to 1. Not strictly integers, but real numbers with at least place values in millionths. The data distribution is peculiar (if I do plot(density(myMatrix)), I get nice bimodal curve

[R] replace items in vector with character based on logical operator

2016-11-12 Thread Adrian Johnson
Hi group, I have a vector of numeric items and I want to replace based on logical operator (> or <) with 'up', 'down' or 'nochange' The way I am doing works sometimes and does not work sometime. I dont understand the problem. In this example, that works for condition DN first, gets over-written

Re: [R] Error installing packages

2016-10-20 Thread Paul Johnson
r layer in this story is that her 30 day free trials were expired, and I have feeling this means that not only is McAfee still installed, but it is also running but refusing to let you interact with it. pj -- Paul E. Johnson http://pj.freefaculty.org Director, Center

[R] pheatmap - clustering on some columns only

2016-10-14 Thread Adrian Johnson
Dear group, I have a matrix (300 rows X 475columns). The data is divided into many classes. For examples: 475 columns are split into 3 categories - A, B and C Is it possible to force clustering of columns in A followed by B and C. I do not want to cluster whole matrix. I want to cluster by 3 categ

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
As Dr.Murdoch suggested, transformation of row 2 is important to make sense in graphical depiction. Thanks to all. On Wed, Oct 12, 2016 at 4:25 PM, Adrian Johnson wrote: > Hello Dr. Carlson, > thanks for the tip. It is exactly what I am looking for. > > I see the trick lies in >

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
David L Carlson > Department of Anthropology > Texas A&M University > College Station, TX 77840-4352 > > > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Adams, Jean > Sent: Wednesday, October 12, 2016 12:44 PM > To: Adrian Johnso

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Thanks Duncan. I am sorry I cannot scale second row (d[2,]). I was looking for a way to plot d[2,] values next to d[1,] with a right side axis=4 on right side. -2,-1,0,1,2 thanks Adrian On Wed, Oct 12, 2016 at 12:42 PM, Duncan Murdoch wrote: > On 12/10/2016 12:20 PM, Adrian Johnson wr

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L, > 528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN", > "CN"), c("DC5", "DC8", "DC14", "DC18", "DC19", "DC20", "DC23" > ))) > plot(m["

[R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Dear group, I have been struggling to barplot two different measurements from one subject. These two measures differ in range. I want to plot row 1 axis on left side and row 2 values on right side. For a given column I want to plot GN and CN next to each other. my dput code is below : structure

[R] pheatmap breaks

2016-08-19 Thread Adrian Johnson
Hi group: I tried multiple times cannot understand the breaks to work for my heatmap. I am using following way: pheatmap(chxx, cluster_cols=FALSE, annotation_col=annotcols, annotation_colors=anno_colors, col=colorRampPalette(c("dark blue", "white", "#ff"))(34), show_colnames=F) > max(chxx)

Re: [R] remove rows based on row mean

2016-08-18 Thread Adrian Johnson
ated(sm$Gene)),] > > Jim > > > On Fri, Aug 19, 2016 at 7:33 AM, Adrian Johnson > wrote: >> Hi Group, >> I have a data matrix sm (dput code given below). >> >> I want to create a data matrix with rows with same variable that have >> higher mean. >

[R] remove rows based on row mean

2016-08-18 Thread Adrian Johnson
Hi Group, I have a data matrix sm (dput code given below). I want to create a data matrix with rows with same variable that have higher mean. > sm Gene GSM529305 GSM529306 GSM529307 GSM529308 1A1BG 6.57 6.72 6.83 6.69 2A1CF 2.91 2.80 3.08 3.00

[R] RGL library loading issues

2016-08-05 Thread Adrian Johnson
Dear group: I installed rgl on my mac through terminal. I used install.packages(rgl) and selected 118 server option. Installation went well until, I get message checking if installed packages working and nothing happens. I opened another terminal window and types library(rgl) and I see my X11qu

[R] generate a vector of random numbers within confines of certain parameters

2016-08-02 Thread Adrian Johnson
Dear group, I am trying to generate a vector of random numbers for 20K observation. however, I want to generate numbers (with 6 decimal places) within the range of Std. Dev : 2-3 mean : 4-6 Is there a method to generate numbers with 6 decimal places under these parameters thank you. Adrian __

[R] How to specify a data frame column using command line arg?

2016-06-05 Thread Douglas Johnson
I'm guessing this is trivial but I've spent two hours searching and reading FAQ, tutorial, introductory and 'idiom' documents and haven't found a solution. All I want to do is select a data frame column at run time using a command line arg. For example, the "test.csv" file contains: a,b,c 1,2,3 4,

Re: [R] if else condition - help

2016-05-22 Thread Adrian Johnson
gt; A 0 0 0 0 > B 1 0 0 0 > C 0 -1 0 0 > D -1 1 -1 -1 > > On Sun, May 22, 2016 at 2:00 PM Adrian Johnson > wrote: >> >> Hi group: >> I am having difficulty with if else condition. I kindly request some help. >> >> I have a matrix k &

[R] if else condition - help

2016-05-22 Thread Adrian Johnson
Hi group: I am having difficulty with if else condition. I kindly request some help. I have a matrix k > k C1 C2 C3 C4 A 0.09902175 -0.1083887 0.2018689 -0.3546167 B 1.60623838 -1.4167034 0.9076373 -0.3161138 C -0.10433133 -1.7060911 -0.4030050 1.0153297 D

[R] Ask if an object will respond to a function or method

2016-03-31 Thread Paul Johnson
cceeds but coef is not listed as a method. Right now, I'm contemplating this: zz1 < - try(coef(zz)) if (inherits(zz1, "try-error")) stop("Your model has no coef method") This seems like a bad workaround because I have to actually run the function in order to find out if t

[R] sorting matrix by sets rows

2016-02-06 Thread Adrian Johnson
Hello: sorry I've been trying to sort a matrix to make waterfall plot using barplot function. I have have 30x5 matrix.Rows are samples and columns are results for a test as numeric vector. I want sort matrix by column. For example, first I want to sort column 1, in decreasing values where col

[R] setting up R -- VM Fusion, WIndows7

2015-07-30 Thread Matthew Johnson
Hi, As i need R to speak to Bloomberg (and big only runs on windows), i'm running windows 7 via VM Fusion on my mac. I think i am having permission problems, as i cannot use install.packages, and cannot change .libPaths via either a .Rprofile, or Profile.site. I've posted more detail in this sup

Re: [R] matrix/df help populate NA

2015-06-14 Thread Adrian Johnson
ames(x2)) >> >> new_x2 <- x2 >> >> for (i in missing) new_x2[[i]] <- NA >> >> new_x2 > Subject AD FH B C > 1 x1 4.3 -2.4 1.3 -2.3 NA NA > 2 x2 2.4 0.1 0.5 -1.4 NA NA > > > > > > Jim Holtman > Data Munger

[R] matrix/df help populate NA

2015-06-13 Thread Adrian Johnson
Dear group: I have two data frames. The column names of the two data frame has some common variables but not identical. my aim is to make 2 DFs more uniform by taking union of both colnames For example: I have x1 and x2 matrices: > x1 SubjectAB CD 1 x1 1.5 -1.3 0.4 -0.2

Re: [R] smooth.spline error while fitting bacterial growth curves with grofit

2015-05-17 Thread Jeffrey David Johnson
t; remote advice from the internet on such complex data (including mine!) > > Cheers, > Bert > > > Cheers, > Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Information is not knowledge. And know

[R] smooth.spline error while fitting bacterial growth curves with grofit

2015-05-17 Thread Jeffrey David Johnson
I'm trying to use the grofit package to compare growth rates between bacterial cultures, but I've come across a couple glitches/things I don't understand. I'm not sure if they're related to the package or to a problem with my growth data, which is messy. Some strains don't follow a proper logarithm

[R] How to pass variable column name into R function

2014-12-18 Thread Jeff Johnson
I know this has been explained a few times here in different scenarios, but I am having a hard time digesting this. The following code works fine as long as it's not inside a function (see below). df$season <- as.character(df$season) temp <- model.matrix( ~ season - 1, data=df) df <- cbind(df

Re: [R] Combining two data frames

2014-09-19 Thread Adrian Johnson
thanks it works I guess: merge(b1,b2,by='Subject') On Fri, Sep 19, 2014 at 5:03 PM, Uwe Ligges wrote: > See ?merge > > Best, > Uwe Ligges > > > On 19.09.2014 22:58, Adrian Johnson wrote: >> >> Hi: >> Appreciate if I could get some help. >

[R] Combining two data frames

2014-09-19 Thread Adrian Johnson
Hi: Appreciate if I could get some help. I have two data frames. I want to combine these two dfs bases on first column. df1 : SubjectG1 G2G3 A 10 1 0 B 20 220 df2: Subject m1m2 m3 A 20 9 30 B

[R] Is it possible to have different animations saved together with the saveSWF command?

2014-09-01 Thread Cheryl Johnson
The way I have programed my code the same animation runs and then starts over again with Adobe Flash. Each time the animation ends and starts is it possible to have a different animation start each time? Thanks in advance for any guidance. [[alternative HTML version deleted]]

Re: [R] populating matrix with binary variable after matching data from data frame

2014-08-14 Thread Adrian Johnson
t; if ((n <- length(extraDimnames[[1]])) > 0) { >> x <- rbind(x, array(0, c(n, ncol(x)), dimnames = >> list(extraDimnames[[1]], >> NULL))) >> } >> if ((n <- length(extraDimnames[[2]])) > 0) { >>

Re: [R] populating matrix with binary variable after matching data from data frame

2014-08-13 Thread Adrian Johnson
Hello again. sorry for question again. may be I was not clear in asking before. I don't want to remove rows from matrix, since row names and column names are identical in matrix. I tried your suggestion and here is what I get: > fx <- function(x,x1){ + i <- as.matrix(x1[,c("V1","V2")]) + x[i]

Re: [R] populating matrix with binary variable after matching data from data frame

2014-08-13 Thread Adrian Johnson
wn wrote: > On Tue, Aug 12, 2014 at 7:14 PM, Adrian Johnson > wrote: >> >> Hi: >> sorry I have a basic question. >> >> I have a data frame with two columns: >> > x1 >> V1 V2 >> 1 AKT3TCL1A >> 2 AKTIPVPS41 >> 3

[R] populating matrix with binary variable after matching data from data frame

2014-08-12 Thread Adrian Johnson
Hi: sorry I have a basic question. I have a data frame with two columns: > x1 V1 V2 1 AKT3TCL1A 2 AKTIPVPS41 3 AKTIPPDPK1 4 AKTIP GTF3C1 5 AKTIPHOOK2 6 AKTIPPOLA2 7 AKTIP KIAA1377 8 AKTIP FAM160A2 9 AKTIPVPS16 10 AKTIPVPS18 I have a matrix 1211

[R] map column name in matrix to multiple elements

2014-08-08 Thread Adrian Johnson
Hi: I am requesting help on matrix mapping. I have a matrix that is 5000 rows x 3000 columns in R env. Matrix: A BC D E S1 0.01 0.2 -0.3 0.8-1 S2 -21.4 2.3 3.1-2 S3 -4 -3-2

[R] mutually exclusive events

2014-08-02 Thread Adrian Johnson
Hi: I am trying to identify mutually exclusive events from the following example: Cluster Gene Mutatednot-mutated 1 G1 1 0 1 G2 1 0 1 G3 0 1 1 G4

[R] Error in file.exists(swf.file) : invalid 'file' argument

2014-07-08 Thread Cheryl Johnson
*I am receiving the error message “*Error in file.exists(swf.file) : invalid 'file' argument*” from my swf2html command. In addition, there is a command that says the Flash file was created: “*Flash has been created at: C:\Users\CHERYL\AppData\Local\Temp\Rtmp6n6FXw\file2.swf*”* *Below is t

[R] Calling Matrices from a Function

2014-07-04 Thread Cheryl Johnson
When I call matrices from a function, they are called but are not recognized as matrices. I use the code below. From the main function, when I use the command is.matrix(), the response is FALSE. Why are the matrices not recognized as matrices? Thanks in advance for any guidance. #This function cre

Re: [R] R Console Output

2014-06-30 Thread Cheryl Johnson
Local\Temp\RtmpqayKkJ/file00109.png" "C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00110.png" "C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00111.png" "C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00112.png" "C:\Users\CHERYL\AppData\Local\Te

[R] R Console Output

2014-06-30 Thread Cheryl Johnson
When I run code in R, my R console output stops before all the code has complied. There are no error messages, but there must be an error somewhere. Thanks in advance for any guidance. [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Run R Code Continuously in the Background of HTML

2014-06-05 Thread Cheryl Johnson
I would like to run R code continuously in the background of a HTML page. This code will run in a loop that has a random number generator. I would like the different values from the random number generator to be displayed on the HTML page as the loop iterates. Thanks in advance for any help.

[R] saveSWF Error Message: file association not available or invalid

2014-05-29 Thread Cheryl Johnson
When I run the code below, I receive the following error message. Thanks in advance for help with fixing this error message. saveSWF({ }, img.name = "file",swf.name = "file2.swf" , single.opts = "'utf8': false", autoplay = FALSE , interval = 0.1, imgdir = "directory", htmlfile = "random.html

[R] Warning Message: In saveSWF({ : the executablepng2swf.exedoes not exist!

2014-05-17 Thread Cheryl Johnson
By using the animation package, I get the warning message "In saveSWF({ : the executablepng2swf.exedoes not exist!". Help in understanding why this message is given will be appreciated. Thanks [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] How to change the font size on the title of a xyplot

2014-05-10 Thread Greg Johnson`
Eduardo M. A. M. Mendes gmail.com> writes: > > Hello > > I am using xyplot (lattice) to plot a xts variable. There are 20 variables within the xts variable (index by a > datetime vector sampled every 1 minute). The results are very nice and help me to understand what is going > on with the

[R] premature evaluation of symbols. Is that the way to describe this problem?

2014-04-10 Thread Paul Johnson
I know, I don't have all the right words here. I've built a toy example that will illustrate the problem, you tell me the words for it. ## Paul Johnson 2014-04-10 dat <- data.frame(x = rnorm(50),y = rnorm(50)) m1 <- lm(y ~ x, dat) myRegFit <- function(model, nd) predict(m

Re: [R] How to join data.frames with different row lengths

2014-03-24 Thread Johnson
re it keeps > every unique 'code' from both datasets and fills the blanks in both > rows with 0: > > FinalDataSet: > Code Cap04 Cap08 > 2 120 120 > 6 75 0 > 7 220 112 > 90 190 > 17

Re: [R] Updating a data frame based on if condition

2014-02-18 Thread Jeff Johnson
TRUE TRUE TRUE FALSE TRUE TRUE FALSE FALSE FALSE TRUE > TRUE FALSE > [25] TRUE TRUE FALSE FALSE FALSE TRUE TRUE FALSE FALSE TRUE > TRUE TRUE > [37] FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE FALSE > TRUE TRUE > [49] TRUE TRUE > > And adding or ch

Re: [R] Updating a data frame based on if condition

2014-02-18 Thread Jeff Johnson
) == 0, TRUE, FALSE ) ) ) On Tue, Feb 18, 2014 at 10:21 AM, Jeff Johnson wrote: > This is my first time with ifelse, but I've tried: > > mydata$FNAME_SUSPECT <- ifelse(mydata$FNAME_TOKEN_COUNT > 3, TRUE, FALSE, > if

Re: [R] Updating a data frame based on if condition

2014-02-18 Thread Jeff Johnson
.@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Jeff Johnson > Sent: Tuesday, February 18, 2014 11:24 AM > To: R help > Subject: [R] Updating a data frame based on if condition > > I have a subset of data that I have identified as "suspect" (f

[R] Updating a data frame based on if condition

2014-02-18 Thread Jeff Johnson
I have a subset of data that I have identified as "suspect" (for example, the first name has excessive spaces, is longer than 35 characters or has a number). What I want to do is update the FNAME_SUSPECT field in "mydata" to TRUE if any of those conditions are met. Here's my data: > dput(mydata)

[R] In RStudio/Win7, which directory stores the "markdown.css" file?

2014-02-03 Thread Jeff Johnson
I'm running Windows 7 and RStudio .98.490. I need to edit the CSS file to test something out, but I've found multiple files and changing them seems to do nothing. It almost seems like the CSS may be cached or something since all changes to it do nothing. FYI, I've read the tutorials on custom CSS a

Re: [R] Controlling font size on code chunk outputs using Knitr

2014-01-31 Thread Jeff Johnson
of x-large and saving the doc, but when I knit the document it does not change anything. Any guidance you can provide would be extremely helpful. Again, I'm using R-Studio on Windows. On Thu, Jan 30, 2014 at 3:54 PM, Jeff Johnson wrote: > Thanks Yihui and Jeff. > > I've

Re: [R] Controlling font size on code chunk outputs using Knitr

2014-01-30 Thread Jeff Johnson
AM, Jeff Newmiller > wrote: > > This sounds like a classic "you need to write a custom CSS file" > problem... Which is off-topic here, so is homework for you. > > > > On January 30, 2014 8:34:32 AM PST, Jeff Johnson > wrote: > >>Hi Yihui, > >&

Re: [R] Controlling font size on code chunk outputs using Knitr

2014-01-30 Thread Jeff Johnson
"FNAME_TOKEN_COUNT", "LNAME_LENGTH", "LNAME_PATTERN", "MNAME_LENGTH", "MNAME_PATTERN", "MNAME_TOKEN_COUNT", "LNAME_TOKEN_COUNT", "EMAIL_LENGTH", "VALID_EMAIL" ), row.names = 1L, class = "data.frame"

Re: [R] Controlling font size on code chunk outputs using Knitr

2014-01-29 Thread Jeff Johnson
at 5:57 PM, Yihui Xie wrote: > > Please provide a minimal example -- are you using R Markdown or R > HTML? Both can produce HTML output: > http://yihui.name/knitr/demo/minimal/ > > Regards, > Yihui > -- > Yihui Xie > Web: http://yihui.name > > >>

[R] Controlling font size on code chunk outputs using Knitr

2014-01-29 Thread Jeff Johnson
Hi there, I'm currently using knitr to generate an html file, however the output of my code is in a font size that's larger than I desire. I've been looking through various options for controlling the font size of the code results, such as the knitr manual, opts_chunk, and latex. The actual code i

[R] KnitR/RMarkdown: Is there a way to not print a section of the document?

2014-01-27 Thread Jeff Johnson
I've been looking through the R documents to see if there's a way to not output certain chunks of code. I'm trying to present a document to a team of folks that won't necessarily be interested in the line-by-line code, though they are interested in the charts, etc. Thus, I'd like to not output cert

[R] subset and na.rm not really suppressing values

2014-01-22 Thread Jeff Johnson
I have a dataset "mydf" with a field EMAIL_ADDRESS. When importing, I specified: mydf <- read.csv(file = extract, header = TRUE, stringsAsFactors = FALSE, na.strings=c("NA","")) I've also tried setting na.strings= c("NA","","") but I don't know if it's appropriate to put there. I'm running a <-

[R] For loop on column names

2014-01-17 Thread Jeff Johnson
I'm trying to find a more efficient to calculate the percent a field is populated and repeat it for each field (column). First, I'm counting the number of lines: lines <- as.integer(countLines(extract) - 1) dput(lines) 10L extract <- 'C:/Users/jeffjohn/Desktop/batchextract_100k_sample.csv' my

[R] Any recommendations for reusable profiling of name fields?

2014-01-17 Thread Jeff Johnson
Hi, I'm pretty new to R and am trying to develop a reusable set of scripts that I can use to profile various data types and common fields in our database. I know that what I'm asking is a can of worms, so please bear with me. :) For example, we store a person's first name, last name, phone number,

[R] Any recommendations for reusable profiling of name fields?

2014-01-16 Thread Jeff Johnson
Hi, I'm pretty new to R and am trying to develop a reusable set of scripts that I can use to profile various data types and common fields in our database. I know that what I'm asking is a can of worms, so please bear with me. :) For example, we store a person's first name, last name, phone number,

Re: [R] Barplot not showing all labels

2014-01-15 Thread Jeff Johnson
, "BR", "BS", "CA", "CH", > > "CM", "CN", "CO", "CR", "CY", "DE", "DK", "DO", "EC", "ES", "FI", > > "FR", "GB", "

Re: [R] Barplot not showing all labels

2014-01-15 Thread Jeff Johnson
;, "TZ", "ZA"), class = "factor")), .Names = "COUNTRY", row.names = c(329L, 1146L, 1474L, 1491L, 1585L, 1997L, 2190L, 2382L, 2442L, 2499L, 2703L, 3151L, 3278L, 3652L, 4730L, 5106L, 5214L, 5447L, 5710L, 5924L, 6185L, 6204L, 6258L, 6383L, 6811L), class = "data.

Re: [R] Subsetting on multiple criteria (AND condition) in R

2014-01-14 Thread Jeff Johnson
e, Jan 14, 2014 at 1:05 PM, Marc Schwartz wrote: > On Jan 14, 2014, at 1:38 PM, Jeff Johnson wrote: > > > I'm running the following to get what I would expect is a subset of > > countries that are not equal to "US" AND COUNTRY is not in one of my > > validcou

Re: [R] Barplot not showing all labels

2014-01-14 Thread Jeff Johnson
Thanks John (and everyone else as well). John's example got it very close. I can tweak from here. Thanks! On Tue, Jan 14, 2014 at 1:22 PM, John Kane wrote: > I am not sure that I got the data correctly--it is much better to supply > sample data using dput(). See ?dput for more information but I

[R] Subsetting on multiple criteria (AND condition) in R

2014-01-14 Thread Jeff Johnson
I'm running the following to get what I would expect is a subset of countries that are not equal to "US" AND COUNTRY is not in one of my validcountries values. non_us <- subset(mydf, (COUNTRY %in% validcountries) & COUNTRY != "US", select = COUNTRY, na.rm=TRUE) however, when I then do table(non_u

  1   2   3   4   >