Re: [R] HISTOGRAM

2018-11-09 Thread Rick Bilonick
First, a histogram would not be appropriate (your data appear to be categorical - a histogram is for continuous numeric vales) - you would need a bar plot. You should make two vectors (one for the category names and the other for the frequencies) and use the barplot function. On Fri, Nov 9, 2018 a

Re: [R] Read

2018-11-09 Thread Rui Barradas
Hello, I've just tested Jeff's solution, it works but the second code line should be dsh <- sh[ , -length( sh ) ] (dsh doesn't exist yet.) Hope this helps, Rui Barradas Às 02:46 de 10/11/2018, Jeff Newmiller escreveu: Your file has 5 commas in the first data row, but only 4 in the header.

Re: [R] Read

2018-11-09 Thread Jeff Newmiller
Your file has 5 commas in the first data row, but only 4 in the header. R interprets this to mean your first column is intended to be row names (has no corresponding column label) rather than data. (Row names are "outside" the data frame... use str(dsh) to get a better picture.) Basically, you

[R] Read

2018-11-09 Thread Val
HI all, I am trying to read a csv file, but have a problem in the row names. After reading, the name of the first column is now "row.names" and all other column names are shifted to the right. The value of the last column become all NAs( as an extra column). My sample data looks like as follow, f

Re: [R] list contingency tables

2018-11-09 Thread Bert Gunter
Yes, exactly (heh, heh). ?fisher.test is probably what is wanted. For arbitrary rxc tables with fixed marginals, this is a difficult problem. Mehta's efficient network algorithm to solve it can be found by a web search on "algorithm for Fisher exact test." -- Bert On Fri, Nov 9, 2018 at 12:3

Re: [R] list contingency tables

2018-11-09 Thread David Winsemius
Seems like you are trying to recreate the calculations needed to perform an exact test. Why not look at the code for that or even easier, just use the function. -- David. On 11/8/18 8:05 PM, li li wrote: Hi all, I am trying to list all the 4 by 2 tables with some fixed margins. For exa

Re: [R] list contingency tables

2018-11-09 Thread Jeff Newmiller
Don't give up on for loops entirely... some of the largest time savings in optimizing loops are achieved by managing memory effectively. [1] [1] https://www.r-bloggers.com/r-tip-use-vectormode-list-to-pre-allocate-lists On November 8, 2018 8:05:39 PM PST, li li wrote: >Hi all, > I am trying t

Re: [R] HISTOGRAM

2018-11-09 Thread Rui Barradas
Hello, You probably want a bar plot, not a histogram. old.sci <- options(scipen=999) with(mydata, barplot(number, space = 0, names.arg = name, beside = TRUE)) options(scipen = old.sci) #- mydata <- read.table(text = " name number ds6277 lk 24375 ax46049 dd70656

[R] HISTOGRAM

2018-11-09 Thread Medic
What would be the correct code (simplest version) (without gplot()) for histogram (with 7 bars), which would include 7 names of bars under the X-axis. The data are: name number ds6277 lk 24375 ax46049 dd70656 az216544 df 220620 gh641827 (I'm attaching mydata.r, making

Re: [R] randomForrest-imputation

2018-11-09 Thread Dénes Tóth
Hi, The missRanger package performs predictive mean matching which should generate positive values if the non-missing values are positive. Regards, Denes On 11/09/2018 01:11 PM, Rebecca Bingert wrote: Hi! How can I generate only positive data with randomForrest-imputation? I'm working with

[R] randomForrest-imputation

2018-11-09 Thread Rebecca Bingert
Hi! How can I generate only positive data with randomForrest-imputation? I'm working with laboratory values which are always positive. Can anybody help out? Thanks! (P.S.: I needed to send this request again because there were problems by delivering it) __

[R] [R-pkgs] New Package pgsc

2018-11-09 Thread Philip Barrett
Dear all, I am pleased to announce a new CRAN package, "pgsc" version 1.0.0 < https://cran.r-project.org/package=pgsc>. This package implements the extension of the synthetic control method to allow for continuous and time-varying treatments described in Powell (2017) . Functions for both estima