Hello,
I'm trying to plot a histogram (or alternatively the density) of a
variable, with a slider that displays a vertical line with the
corresponding quantile of the distribution of the variable. That is, I what
to interactivity pick for example, the median, and have the vertical line
move to the
Try using the openxlsx package; it does not require Java.
Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.
On Sat, Apr 23, 2016 at 3:43 PM, jpm miao wrote:
> Hi,
>
>I tried to read a (small) xlsx file by
Or grab https://cran.r-project.org/web/checks/check_results.rds and
read it w/o the need for scraping.
On Sat, Apr 23, 2016 at 10:43 AM, David Winsemius
wrote:
>
>> On Apr 23, 2016, at 6:56 AM, David Winsemius wrote:
>>
>>
>>> On Apr 22, 2016, at 11:51 AM, mylistt...@gmail.com wrote:
>>>
>>> Dea
Hi
I need to insert a blank row after every row in R data frame. I have achieved
it through:
df[rep(1:nrow(df),1,each=2),]
But it inserts a row with name of previous row, while i want a complete blank
row without any name/title.
Please guide me
Regards
Saba
Hi Saba,
I don't know how to do what you want and I also cannot see why.
If you describe what you hope to achieve there might be a different
solution.
Best wishes
Ulrik
Saba Sehrish via R-help schrieb am So., 24. Apr.
2016 14:04:
> Hi
>
> I need to insert a blank row after every row in R data
You can use 'dplyr':
> library(dplyr)
> df1 <- read.table(text = "ID A B
+ 1 1 2
+ 1 0 3
+ 25 NA
+ 2 1 3
+ 3 1 4
+ 4 NA NA
+ 4 0 1
+ 4
Well, something like this would work (there may be slicker solutions):
> z <- data.frame(a=1:3,b = letters[1:3])
> i <- seq_len(nrow(z)) *2
> z <-rbind(z,z)
> z[i, ] <- matrix(NA, nr=nrow(z),nc=ncol(z))
> z
ab
1 1a
2 NA
3 3c
4 NA
5 2b
6 NA
But I agree with you that there
You never did provide a reproducible example or say how you wanted to
plot. Here is a way to get a subset of t1 or t2, and you can then use it
as input to ggplot:
library(dplyr)
your_subset <- df %>%
mutate(key = grep(".*(t1|t2).*", "\\1", Command, value = TRUE))
%>%
filter(!(
Oh, sorry, I just realized that I messed up the indicing. Here is the
correct way:
> z <- data.frame(a=1:3,b = letters[1:3])
> i <- seq_len(nrow(z))
> z<-z[rep(i,e=2),]
> z[2*i, ] <- matrix(NA, nr=nrow(z),nc=ncol(z))
> z
Still doubt that this is a good idea, though.
-- Bert
Bert Gunter
"T
This will handle all the columns; it assumes the ones you want to start
with are in column 2 through the end:
> library(dplyr)
> df1 <- read.table(text = "ID A B
+ 1 1 2
+ 1 0 3
+ 25 NA
+ 2 1 3
+ 3
Starting from this data frame:
my.df <- data.frame(num = 1:5, let = letters[1:5])
> my.df
num let
1 1 a
2 2 b
3 3 c
4 4 d
5 5 e
>
and inserting a blank row (NAs row) for each one of my.df rows.
na.df <- data.frame(num = NA, let = NA)
my.df <- do.call(rbind, apply(my.df, 1
df1 <- data.frame(ID = c(1,1,2,2,3,3,4,4,5,5),
A = c(1,0,5,1,1,NA,0,3,2,7),
B = c(2,3,NA,3,4,NA,1,0,5,NA))
df2 <- data.frame(ID = c(1,2,3,4,5),
A = c(1,6,1,3,9),
B = c(5,3,4,1,5))
m <- match(df1$ID, df2$ID)
sel <- c("A",
my problem is that in Command I have 2229 levels and I want to do subsets based
on the names I have in Command. for example if the name has t1 or t2 in it or
if it has both of them.and then I need to plot in a way that colors are names
with t1,names with t2 and names with both. But now even t
'grepl' returns a logical vector; you have to use this to get your subset.
You can use:
df_tq <- subset(df, grepl("t1", Command))
df_t2 <- subset(df, grepl("t2", Command))
# if you want to also get a subset that has both, use
df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command))
I am just beginning to learn R, using _R for Dummies_ by Andrie de Vries and
Joris Meys. I am using Windows 7, and RGui (64-bit) version 3.0.2. I have
reached the chapter on "Getting Data Into and Out of R." But the code they use
for importing data doesn't seem to be working for me.
Their examp
Hi,
I have a multidimensional data-set( multiple 'x' variables with a target
variable). I want to take it to a higher dimensional space so that I can
apply classification technique with ease . Is there a package in R which
would allow me to take these data points from lower dimensional space to
hi
You probably have not reset the directory -- go to the session tab on the R
window, click and go to “set working directory” as C
Nick
Original Message --
From: WRAY NICHOLAS
To: Jason Hernandez
Date: 24 April 2016 at 21:44
Subject: Re: [R] Using read.csv() to import data
You
On 24/04/2016 4:30 PM, Jason Hernandez via R-help wrote:
I am just beginning to learn R, using _R for Dummies_ by Andrie de Vries and Joris Meys.
I am using Windows 7, and RGui (64-bit) version 3.0.2. I have reached the chapter on
"Getting Data Into and Out of R." But the code they use for impo
Many:
https://cran.r-project.org/web/views/MachineLearning.html
-- 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 Sun, Apr 24, 2016 at 10:39 AM, Devesh
now after this:
df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command))
I use factor to apply the subset to df but then the Command level becomes 0
df_both$Command=factor(df_both$Command)
str(df_both)
$ Protocol : Factor w/ 0 levels:
Do you know what is the r
Isn't the normal way to do this to collect additional independent variables as
part of your test protocol?
--
Sent from my phone. Please excuse my brevity.
On April 24, 2016 10:39:06 AM PDT, Devesh Raj Singh
wrote:
>Hi,
>
>I have a multidimensional data-set( multiple 'x' variables with a
>tar
Check the size of df_both. It would be that there are no Command fields
that contain both a 't1' and 't2'.
You can so do:
sum(grepl("t1", df$Command) & grepl("t2", df$Command))
to see how many Command fields contain both.
Jim Holtman
Data Munger Guru
What is the problem that you are trying t
HI, I am trying to use switch () function to connect the three distribution
(normal ,gamma with equal skewness and gamma with unequal skewness.
But i am losing my ideas since i have
sample sizes-(10,10),(10,25),(25,25),(25,50),(25,100),50,25),(50,100),
(100,25),(100,100)
standard deviation rat
Hi Adrian,
This is probably taking a long time. I first tried with 7x10^6 times
and values and it took several minutes. The following code does what I
expected:
amdat<-data.frame(time=1:70,value=rnorm(70,-4))
amdat$value[amdat$value<0]<-0
sum(amdat$value)
[1] 5.07101
plot(amdat$time,amdat$
Hi,
I have a char vector with year values. Some cells have single year
value '2001-' and some have range like 1996-2007.
I need to remove hyphen character '-' from all the values within the
character vector named as 'end'. After removing the hyphen I need to
get the last
number from the cells where
Hi
Is this
http://stackoverflow.com/questions/2150138/how-to-parse-milliseconds-in-r
what do you want?
Cheers
Petr
> -Original Message-
> From: Sidoti, Salvatore A. [mailto:sidoti...@buckeyemail.osu.edu]
> Sent: Sunday, April 24, 2016 1:48 AM
> To: PIKAL Petr ; William Dunlap
> ; Ista
26 matches
Mail list logo