Dear Ivan,
I don't think it is possible to force a number of rows - but I'm
honestly just guessing.
What you can do is to add an empty plot. Here I use cowplot, but
gridExtra should also work well.
I add an indication of the row number for the plot to the initial
data.frame, and loop over
= df)
}, ranges = ranges, .id = "filename")
```
On 2020-08-27 17:33, Ulrik Stervbo via R-help wrote:
Hi Thomas,
I am not familiar with the use of the range argument, but it seems to
me that the cell value becomes the column name. This might be fine,
but you might get into trouble if yo
Hi Thomas,
I am not familiar with the use of the range argument, but it seems to me
that the cell value becomes the column name. This might be fine, but you
might get into trouble if you have repeated cell values since
as.data.frame() will fix these.
I am also not sure about what you want, b
Hi Prasad,
I think this might be a problem with the package, and you can try to
contact the package author.
The error seem to arise because the pcr() cannot find the
'negative-binomial' distribution
```
library(qualityTools)
x <- rnbinom(500, mu = 4, size = 100)
pcr(x, distribution = "negat
ear Ulrik,
>
>On 2020-07-29 17:14 +0200, Ulrik Stervbo via R-help wrote:
>> library(readr)
>> read_csv(
>
>This thread was about
>sqldf::read.csv.sql ...
>
>What is the purpose of bringing up
>readr::read_csv? I am unfamilliar with
>it, s
You might achieve this using readr:
```
library(readr)
lines <- "Id, Date, Time, Quality, Lat, Long
STM05-1, 2005/02/28, 17:35, Good, -35.562, 177.158
STM05-1, 2005/02/28, 19:44, Good, -35.487, 177.129
STM05-1, 2005/02/28, 23:01, Unknown, -35.399, 177.064
STM05-1, 2005/03/01, 07:
You might achieve this using readr:
```
library(readr)
lines <- "Id, Date, Time, Quality, Lat, Long
STM05-1, 2005/02/28, 17:35, Good, -35.562, 177.158
STM05-1, 2005/02/28, 19:44, Good, -35.487, 177.129
STM05-1, 2005/02/28, 23:01, Unknown, -35.399, 177.064
STM05-1, 2005/03/01, 07:
Hi Pedro,
I see you use dplyr and ggplot2. Are you looking for something like
this:
```
library(ggplot2)
library(dplyr)
test_data <- data.frame(
year = c(rep("2018", 10), rep("2019", 8), rep("2020", 6)),
value = sample(c(1:100), 24)
)
test_data <- test_data %>%
group_by(year) %>%
mut
Then this should work:
```
library(ggplot2)
library(cowplot)
p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point()
p2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width * 1000)) +
geom_point()
plot_grid(p1, p2, ncol = 1, align = "hv", rel_heights = c(2, 1), axis =
"t
Would this work:
```
library(ggplot2)
library(cowplot)
p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) +
geom_point()
p2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width * 1000)) +
geom_point()
plot_grid(p1, p2, ncol = 1, align = "hv", rel_heights = c(2, 1))
```
Best,
Ulrik
Hi Sumitrajit,
dplyr has a function for this - it's called filter.
For each group you can count the number of SNR > 3 (you can use sum on
true/false). You can filter on the results directly or add a column as
you plan. The latter might make your intention more clear.
HTH
Ulrik
On 2018-05-30
I would use
sub("\\(.*\\)", "()", s)
It is essentially the same as Rui's suggestion, but I find the purpose to
be more clear. It might also be a little more efficient.
HTH
Ulrik
On Mon, 21 May 2018, 15:38 Rui Barradas, wrote:
> Hello,
>
> Try this.
>
>
> ss1 <- "z:f(5, a=3, b=4, c='1:4', d=2)
I have no idea, but Google pointed me to this
https://cran.r-project.org/web/packages/subscore/index.html
Hth
Ulrik
"Hyunju Kim" schrieb am Di., 15. Mai 2018, 07:21:
>
>
>
> Hello,
>
>
>
> I want to compute Wainer et al's augmented subscore(2001) using IRT but I
> can't find any packages or re
Hi Christofer,
it works for me. Perhaps you need up update a package?
Best wishes,
Ulrik
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /u
Hi Neha,
Perhaps merge() from base or join from dplyr is what you are looking for.
data. table could also be interesting.
Hth
Ulrik
On Wed, 2 May 2018, 21:28 Neha Aggarwal, wrote:
> Hi
>
> I have 3 dataframes, a,b,c with 0/1 values...i have to check a condition
> for dataframe a and b and the
I asked the moderators about it. This is the reply
"Other moderators have looked into this a bit and may be able to shed more
light on it. This is a "new" tactic where the spammers appear to reply to
the r-help post. They are not, however, going through the r-help server.
It also seems that this
There are plenty of options for reading csv files. For built-in solutions
look at ?read.csv or at read_csv from the package reader.
If the measurements are ordered in columns rather than in rows, reading the
data can be very slow.
HTH
Ulrik
Mohammad Areida schrieb am Mo., 16. Apr. 2018, 13:25:
Hi Omar,
you are almost there but! Your first substitution looks 'www' as the
start of the line followed by anything (which then do nothing), so your
second substitution removes everything from the first '.' to be found
(which is the one after www).
What you want to do is
x <- "[2440810] / ww
I think I would replace all , with . and subsequently replace all first .
with , using ^\\.
x <- gsub(",", ".", x)
gsub("^\\.", ",", x)
It's not so elegant, but it is easier to understand than backreferences and
complex regex.
Best,
Ulrik
On Tue, 13 Feb 2018, 03:38 Boris Steipe, wrote:
> You
From: William Dunlap [wdun...@tibco.com]
> Sent: Saturday, January 27, 2018 4:57 PM
> To: Marsh Hardy ARA/RISK
> Cc: Ulrik Stervbo; Eric Berger; r-help@r-project.org
> Subject: Re: [R] Newbie wants to compare 2 huge RDSs row by row.
>
> If your two objects have class "data.frame&q
Also, it will be easier to provide helpful information if you'd describe
what in your data you want to compare and what you hope to get out of the
comparison.
Best wishes,
Ulrik
Eric Berger schrieb am Sa., 27. Jan. 2018, 08:18:
> Hi Marsh,
> An RDS is not a data structure such as a data.frame.
I think I would use pdftk to extract the form data. All subsequent
manipulation in R.
HTH
Ulrik
Eric Berger schrieb am Mi., 24. Jan. 2018, 08:11:
> Hi Scott,
> I have never done this myself but I read something recently on the
> r-help distribution that was related.
> I just did a quick search
You could loop over the file names, read each excel file and store the
individual data frames in a list using lapply.
I prefer to read excel files with the package readxl.
The code could be along the lines of
library(readxl)
my_files <- c("file1", "file2")
lapply(my_files, read_excel)
HTH
Ulri
ggplot and facets might be useful.
Ulrik
Ismail SEZEN schrieb am Mo., 27. Nov. 2017, 14:06:
>
> > On 27 Nov 2017, at 13:59, Engin YILMAZ wrote:
> >
> > Dear Berger and Jim
> >
> > Can you see my eviews example in the annex? (scattersample.jpg)
> >
> > Sincerely
> > Engin
>
> Please, use an ima
Hi Elahe,
You pass 'probable' to the fill aesthetic along the lines of;
ggplot(hist) +
aes(x=mms, fill = probable) + geom_histogram(binwidth=1)
The NAs might give you three and not two colours.
I'm guessing you want distinct colours. In this case 'probable' should be a
factor and not an integ
And
head(test_df$Movie, 10)
For function completeness :-)
Rui Barradas schrieb am So., 5. Nov. 2017, 20:56:
> Hello,
>
> Also
>
> tail(test_df$Movie, 10)
>
> Hope this helps,
>
> Rui Barradas
>
> Em 05-11-2017 19:18, Ulrik Stervbo escreveu:
> > R can
R can have a bit of a learning curve... There are several ways to achieve
your goal - depending on what you want:
test_df <- data.frame(Movie = letters, some.value = rnorm(26))
test_df$Movie[1:10]
test_df$Movie[sample(c(1:26), 10)]
test_df[sample(c(1:26), 10), ]
Do read a tutorial or two on R
Hi Hermant,
It sounds lile grep from base or str_detect from the Stringr package is
what you want.
Best,
Ulrik
Hemant Sain schrieb am Mi., 1. Nov. 2017, 08:31:
> i want to tag categories to its menuname.
> i have a csv containing menu item name and in other csv i have a column
> containing som
Hi Duncan,
why not split on / and take the correct elements? It is not as elegant as
regex but could do the trick.
Best,
Ulrik
On Mon, 9 Oct 2017 at 17:03 Duncan Murdoch wrote:
> I have a file containing "words" like
>
>
> a
>
> a/b
>
> a/b/c
>
> where there may be multiple words on a line (se
Hi BFD,
?geom_contour() *does* have helpful examples. Your Google-foo is weak:
Searching for geom_contour brought me:
http://ggplot2.tidyverse.org/reference/geom_contour.html as the first
result.
HTH
Ulrik
On Mon, 9 Oct 2017 at 08:04 Big Floppy Dog wrote:
> Can someone please point me to an ex
How about geom_contour()?
Am So., 8. Okt. 2017, 20:52 schrieb Ranjan Maitra :
> Hi,
>
> I am no expert on ggplot2 and I do not know the answer to your question. I
> looked around a bit but could not find an answer right away. But one
> possibility could be, if a direct approach is not possible, t
Hi John,
I don't know how to do this with R, but on Linux I'd use rename (or maybe
even by hand if it's a one time event). On Windows I believe there is a
tool called Bulk Rename.
HTH
Ulrik
On Thu, 28 Sep 2017 at 11:37 John wrote:
> Hi,
>
>I have 50 files whose names are
>
> XYZW01Genesis_
Hi Troels,
Try to move the size argument out of the aesthetic.
Best wishes,
Ulrik
On Mi., 27. Sep. 2017, 08:51 Troels Ring wrote:
> Dear friends - below is a subset of a much larger material showing two
> ways of generating two "lines". The intention is to have the colour
> reflect a variable,
at the file was loaded to R. But when I typed the data
> name, it says that the not found.
>
> > *datahs0csv2*
>
> *Error: object 'datahs0csv2' not found*
>
>
> with many thanks
> abou
>
> On Tue, Sep 12, 2017 at 2:53 PM, Ulrik Stervbo
> wrote:
>
>
Hi Abou,
You haven't saved the datahs0csv.
When you are done manipulating datahs0csv you can use save(datahs0csv, file
= 'datahs0csv.rda'). Then you should be able to load the data.
HTH
Ulrik
On Tue, 12 Sep 2017, 20:46 AbouEl-Makarim Aboueissa <
abouelmakarim1...@gmail.com> wrote:
> Dear All:
>
Hi Hemant,
please write to the r-help list in the future.
Look at the cut () function to solve your problem.
Also, you have a problem in your example - 5 is placed in two different
categories.
HTH
Ulrik
On Fri, 8 Sep 2017 at 12:16 Hemant Sain wrote:
> i have a vector containing values rangin
;% gather("Foo", "Item") %>%
> filter(!is.na(Item)) %>%
> left_join(data_help, by = "Item") %>%
> group_by(Foo, Purchase_ID) %>%
> summarise(Item = paste(Item, collapse = ", ")) %>%
> spread(key = "Foo"
done on the
>> basis of quantity and in real data set quantity is missing. so please use
>> following data set and help me out please consider this mail is my final
>> email i won't bother you again but its about my job please help me
>> .
>>
>> Note* th
Hi Hemant,
Does this help you along?
table_1 <- textConnection("Item_1;Item_2;Item_3
1KG banana;300ML milk;1kg sugar
2Large Corona_Beer;2pack Fries;
2 Lux_Soap;1kg sugar;")
table_1 <- read.csv(table_1, sep = ";", na.strings = "", stringsAsFactors =
FALSE, check.names = FALSE)
table_2 <-
textCon
; according to the plot.
> your code will not work in both the scenario
>
> Regards
> Niharika Singhal
>
>
> On Sat, Aug 26, 2017 at 12:47 PM, Ulrik Stervbo
> wrote:
>
>> Hi,
>>
>> I once found this somewhere on stackoverflow:
>>
>> values <- r
Hi,
I once found this somewhere on stackoverflow:
values <- rnorm(20, mean = c(2.15,2.0,2.9), sd = c(0.1,0.1,0.1))
v_dens <- density(values)
v_dens_y <- v_dens$y
r <- rle(v_dens_y)
# These functions ignore the extremes if they are the first or last point
maxima_index <- which(rep(x = diff(sign(
HI lily,
for the colouring of individual points you can set the colour aesthetic.
The ID is numeric so ggplot applies a colour scale. If we cast ID to a
factor we get the appropriate colouring.
test_df <- data.frame(ID = 1:20, v1 = rnorm(20), v2 = rnorm(20), v3 =
rnorm(20))
ggplot(data=test_df,
Hi Venkat,
I must admit I don't understand what you are looking for, but maybe just
store the visuals in a named lIst?
Also, I have started to use nested data.frames to keep plots together with
identifiers of the data sets. The nest and unnest functions are in the
tidyr package. It keeps me from
Hi Andreas,
assuming that the increment is always indicated by the same value (in your
example 0), this could work:
df$a <- cumsum(seq_along(df$b) %in% which(df$b == 0))
df
HTH,
Ulrik
On Sun, 6 Aug 2017 at 18:06 Bert Gunter wrote:
> Your specification is a bit unclear to me, so I'm not sure t
I have no clue how Rstudio saves plots, but when I was writing directly to
the pdf plot device I had similar problems. Setting useDingbats = TRUE made
everything work well.
I think it is more prudent - and less clicking here and there - to save
plots from within the script.
I imagine this works a
Hi Giovani,
I would create an unnamed list and set the names after.
Best,
Ulrik
On Fri, 4 Aug 2017 at 12:08 Giovanni Gherdovich
wrote:
> Hello,
>
> I'm having troubles defining a list where names are variables (of type
> character). Like this, which gives "foo" instead of "world" (the way I
>
Hi Matt,
the usual way would be to use do.call():
.lst <- list(x = list(a = 1, b = 2), y = list(a = 5, b = 8))
do.call(rbind, lapply(.lst, data.frame, stringsAsFactors = FALSE))
however, your list has vectors of unequal lengths making the above fail.
You somehow need to get everything to have th
On second thought, you could also use pdftk to fill out the pdf form with
data generated in R.
On Wed, 26 Jul 2017 at 14:01 Ulrik Stervbo wrote:
> Hi Elahe,
>
> I have no clue, but maybe you can dump the data fields using pdftk, and
> work with those in R.
>
> HTH
> Ulr
Hi Elahe,
I have no clue, but maybe you can dump the data fields using pdftk, and
work with those in R.
HTH
Ulrik
On Wed, 26 Jul 2017 at 13:50 Elahe chalabi via R-help
wrote:
> Hi all,
>
> I would like to get ideas about how to fill out a PDF form in R and to
> know if it's possible or not. I
Hi Rosa,
You pass a vector to ggplot, which expects a data.frame. I am sure you
meant to do this:
point7$y_point7 <- point7$beta0_7 + point7$beta1_7*point7$time + point7
$epsilon_7
ggplot(point7, aes(time, y_point7)) + geom_line()
HTH
Ulrik
On Wed, 19 Jul 2017 at 20:37 Rosa Oliveira wrote:
Hi Ana,
The path is most likely wrong.
How does f.texto() know the res.path? Do you manage to remove the old path
and create a new one but f.texto() doesn't know?
Not reasons for your problem, but curious: Why do you change the working
directory? What is the intention behind appending dir(res.pa
Hi Michael,
Try gather from the tidyr package
HTH
Ulrik
Michael Reed via R-help schrieb am So., 16. Juli
2017, 10:19:
> Dear All,
>
> I need some help arranging data that was imported.
>
> The imported data frame looks something like this (the actual file is
> huge, so this is example data)
>
tst[chk,,drop=FALSE]
>
> This both assumes and requires that ALL of the rows are structured as in
> the example data in the original question.
> For example:
> if any row is missing the “:”, it will fail.
> If the “:” is not followed by a space character it may fail (I have not
> che
Hi Vijayan,
one way going about it *could* be this:
library(dplyr)
library(tidyr)
library(purrr)
ex_dat <- c("FName: fname1", "Fval: Fval1.name1", "Fval: ", "FName:
fname2", "Fval: Fval2.name2", "FName: fname3")
data.frame(x = ex_dat) %>%
separate(x, c("F1", "F2"), sep = ": ") %>%
filter(F2
Hi Sema,
read.csv2 use ',' as the decimal separator. Since '.' is used in your file,
everything becomes a character which in turn makes pam complain that what
you pass to the function isn't numeric.
Use read.csv2("data.csv", dec = ".") and it should work.
You can also use class(d) to check the c
Hi Tara,
It seems that you categorise and count for each category. Could it be that
the method you use puts everything that doesn't match the predefined
categories in Other?
I'm only guessing because without a minimal reproducible example it's
difficult to do anything else.
Best wishes
Ulrik
R
Hi Mario,
does acast from the reshape2 package help?
dfa<- data.frame(iso_o = letters[c(1, 1:4)], iso_d = letters[6:10], year =
c(1985, 1985, 1986, 1987, 1988), flow = c(1,2,3,4, NA))
reshape2::acast(dfa, iso_o ~ iso_d, fun.aggregate = sum, value.var = "flow")
HTH
Ulrik
On Fri, 26 May 2017 at 1
It is correct and will produce a data.frame. But I guess the result is not
what you intend since the resulting data.frame nothing but NA and Samples
in the diagonal:
df1 <- data.frame(x = letters[1:5], y = letters[6:10])
reshape2::dcast(df1, x ~ y)
You are missing values somewhere. If you want al
Hi Lily,
maybe you should read up on what bind_rows/bind_cols (or the base functions
rbind and cbind) do.
bind_cols and cbind will fail in this case because of the different number
of rows.
bind_rows and rbind will fail because the column names are different - how
can R know that month and mon r
What is your version of readxl?
In my version 1.0, there is no directory called estdata, but there is one
called extdata. However, in that directory there is no file called
"results.xlsx"
Either it was there once and has now gone missing or "results.xlsx" your
own file? It looks like the latter -
Hi Marine,
your manipulation of the matrix is quite convoluted, and it helps to expand
a bit:
test_lst <- split(test, test[,c("id")])
test_lst$`1`
after splitting, your matrix has gone back to be a plain vector, which
makes the sampling fail.
The reason is that, a matrix - behind the scenes - i
Does
scale_x_date(date_breaks = "1 month")
do what you want?
Ulrik
John Kane via R-help schrieb am Sa., 13. Mai 2017,
17:12:
> Could we see some sample data?
>
>
> On Tuesday, May 9, 2017 9:55 PM, Jeff Reichman <
> reichm...@sbcglobal.net> wrote:
>
>
> r-help
>
>
>
> Trying to figure out
I haven't tested it but the first thing I'd look at is scale_fill_gradient.
HTH
Ulrik
Jim Lemon schrieb am Do., 11. Mai 2017, 07:22:
> Hi Kristi,
> It can be done, but it is messy:
>
> pl = data.frame(Time = 0:10, menle = rnorm(11))
> pl$menlelb = pl$menle -1
> pl$menleub = pl$menle +1
> rg<
indata=v5,
> n1=114, n2=119, n3=116, fig_descrip=Figure 2”
>
> Even this call gives the same error: plot_f1(indata=v5, n1=114, n2=119,
> n3=116, fig_descrip=Figure)
>
>
> Thanks,
>
> Gerard
>
>
>
>
>
>
> On May 8, 2017, at 11:40 PM, Ulrik Stervbo
>
ach me about the correct formation of the syntax?. I
> have read the help page and other online resources about inner,left,&right
> join but wasn't able to formulate the correct syntax.
>
>
> Sent from my Samsung device
>
>
> ---- Original message
> Fr
Hi Abo,
?merge
or the join functions from dplyr.
HTH
Ulrik
On Tue, 9 May 2017 at 06:44 abo dalash wrote:
> Hi All ..,
>
>
> I have 2 tables and I'm trying to have some information from the 1st table
> to appear in the second table with different order.
>
>
> For Example, let's say this is my
HI Gerard,
You get the literals because the variables are not implicitly expanded -
'Placebo(N=n1) ' is just a string indicating the N = n1.
What you want is to use paste() or paste0():
c(paste0("Placebo(N=", n1, ")"), paste0("Low Dose (N=", n2, ")"),
paste0("High Dose (N=", n3, ")"))
should do
Hi Bruce,
while working with data I would not touch the formatting of the columns. If
knowing the units is important, you can add it to the column name rather
than the values of the columns.
For presentation purposes - where everything is turned into strings - it is
a different story. Once you ar
Hi Bruce,
display as in the console or as a table for presentation?
For the latter, look at sprintf:
sprintf("%,1f", 1)
sprintf("%.2f", 2.5678)
sprintf("$%.3f", 2.5678)
HTH
Ulrik
On Fri, 5 May 2017 at 14:08 Bruce Ratner PhD wrote:
> R-helpers:
> I need some references for formatting the disp
Hi Prateek,
maybe facet_* with ggplot is what you are looking for
HTH
Ulrik
On Thu, 20 Apr 2017 at 13:24 prateek pande wrote:
> HI Hasan,
>
> Thanks for sharing the solution. Really appreciate it.
>
> But i was reading somewhere that we cannot use par with ggplot 2 . we can
> only use grid ext
Hi Troels,
I get no error. I think we need more information to be of any help.
Best wishes,
Ulrik
On Fri, 7 Apr 2017 at 08:17 Troels Ring wrote:
> Dear friends - I have further problems handling dates_times, as
> demonstrated below where concatenating two formatted vectors of
> date_times res
Hi Ben,
type.convert should do the trick:
m %>%
as_tibble() %>%
lapply(type.convert) %>%
as_tibble()
I am not too happy about to double 'as_tibble' but it get the job done.
HTH
Ulrik
On Thu, 6 Apr 2017 at 16:41 Ben Tupper wrote:
> Hello,
>
> I have a workflow yields a character matrix
'Snakemake' (https://snakemake.readthedocs.io/en/stable/) was created to
ease pipelines through different tools so it might be useful.
In all honesty I only know of Snakemake, so it might be the completely
wrong horse.
HTH
Ulrik
On Fri, 31 Mar 2017 at 06:01 Wensui Liu wrote:
> How about pyper?
Hi Georg,
you were on the right path - it is all about scale_fill*
The 'problem' as you've discovered is that value is continuous, but
applying scale_fill_manual or others (except scale_fill_gradient) expects
discrete values.
The solution is simply to set the fill with that by using factor():
g
Hi Georg,
I am a little unsure of what you want to do, but maybe this:
mdf <- melt(dfr)
d_result <- mdf %>%
dplyr::group_by(variable, value) %>%
summarise(n = n())
ggplot(
d_result,
aes(variable, y = n, fill = value)) +
geom_bar(stat = "identity")
HTH
Ulrik
On Tue, 28 Mar 2017 at 15
Hi Paul,
does this do what you want?
exdf1 <- data.frame(Date = c("1985-10-01", "1985-11-01", "1985-12-01",
"1986-01-01"), Transits = c(NA, NA, NA, NA))
exdf2 <- data.frame(Date = c("1985-10-01", "1986-01-01"), Transits = c(15,
20))
tmpdf <- subset(exdf1, !Date %in% exdf2$Date)
rbind(exdf2, tmp
You could use merge() or %in%.
Best,
Ulrik
Mark Sharp schrieb am Mo., 27. März 2017, 22:20:
> Make some small dataframes of just a few rows that illustrate the problem
> structure. Make a third that has the result you want. You will get an
> answer very quickly. Without a self-contained reprodu
Hi Elahe,
maybe the us.cities() in the maps package is what you look for.
HTH
Ulrik
On Thu, 23 Mar 2017 at 11:34 Elahe chalabi via R-help
wrote:
> Hi all,
>
> I have a data frame containing serial numbers for US. I also have a column
> showing the city in US, now my question is is there a pack
Hi Joe,
you could also rethink your pattern:
grep("x1 \\+ x2", test, value = TRUE)
grep("x1 \\+ x", test, value = TRUE)
grep("x1 \\+ x[0-9]", test, value = TRUE)
HTH
Ulrik
On Wed, 22 Mar 2017 at 02:10 Jim Lemon wrote:
> Hi Joe,
> This may help you:
>
> test <- c("x1", "x2", "x3", "x1 + x2 +
Using dplyr:
library(dplyr)
# Counting unique
DF4 %>%
group_by(city) %>%
filter(length(unique(var)) == 1)
# Counting not duplicated
DF4 %>%
group_by(city) %>%
filter(sum(!duplicated(var)) == 1)
HTH
Ulrik
On Sat, 18 Mar 2017 at 15:17 Rui Barradas wrote:
> Hello,
>
> I believe this do
Hi Evan
you can easily do this by applying diff() to each exp group.
Either using dplyr:
library(dplyr)
mydata %>%
group_by(exp) %>%
summarise(difference = diff(rslt))
Or with base R
aggregate(mydata, by = list(group = mydata$exp), FUN = diff)
HTH
Ulrik
On Fri, 17 Mar 2017 at 17:34 Evan C
Hi Georg,
If you remove the coord_polar, you'll see that the optimal y-value for the
labels is between the upper and lower bound of the stacked bar-element.
I am not sure it is the most elegant solution, but you can calculate them
like this:
df <- data.frame(group = c("Male", "Female", "Child"),
I imagine that the FieldStateOption is irrelevant, so you might be able to
create a data.frame like this:
library(tidyr)
fl <- readLines("pdf_dump.txt")
fl <- grep("FieldStateOption", fl, value = TRUE, invert = TRUE)
field_number <- vector(mode = "integer", length = length(fl))
tmpid <- 0
for(i
Hi Roslinazairimah,
As Bert suggested, you should get acquainted with regular expressions. It
can be confusing at times, but pays off in the long run.
In your case, the pattern of "^[A-Z]{2}14.*" might work.
Best,
Ulrik
On Mon, 13 Mar 2017 at 06:20 roslinazairimah zakaria
wrote:
> Another que
You need to set the aesthetic 'group' to something meaningful, probably ID
in this case.
HTH
Ulrik
On Fri, 10 Mar 2017, 19:30 Rayt Chiruka, wrote:
> i am trying to convert a dataset from wide to long format using package
> tidyr- (seems to have been done)
>
> wen in try and plot the long datase
I don't know if there's a pure R option, but i believe pdftk can extract
the form data which you can then manipulate in R.
Best
Ulrik
On Sat, 11 Mar 2017, 05:14 Vijayan Padmanabhan, <
padmanabhan.vija...@gmail.com> wrote:
> Dear R-Help group
> Is there any way that I can programmatically extract
Hi Greg,
?theme
You can use the axis.text and axis.title if y and x are to be identical, or
axis.text.x, axis.text.y, axis.title.x, axis.title.y if you need different
font size.
HTH
Ulrik
On Fri, 10 Mar 2017 at 15:47 greg holly wrote:
> Hi all;
>
> The followings are my R codes for heat maps
Hi Petr,
maybe
library("splitstackshape")
cSplit(evid, "V4", "#", direction = "long")
or
library("tidyr")
separate_rows(evid, V4, sep = "#")
is helpful.
Best,
Ulrik
On Fri, 10 Mar 2017 at 08:32 PIKAL Petr wrote:
Dear all
I have some data with following structure in data frame.
dput(evid[
ling adn loading tve
> Hmisc package but wasn't able to do that either.
>
>
> Mensaje original
> Asunto: Re: [R] Unable to Load package Rcmdr after installation
> De: Ulrik Stervbo
> Para: Paul Bernal ,r-help@r-project.org
> CC:
>
>
> Hi Paul,
>
Hi Evan,
the unite function of the tidyr package achieves the same as Jim suggested,
but in perhaps a slightly more readable manner.
Ulrik
On Fri, 10 Mar 2017 at 07:50 Jim Lemon wrote:
> Hi Evan,
> How about this:
>
> df2<-data.frame(Trt=df[,1],Conc=apply(df[,2:5],1,paste,sep="",collapse=""))
Hi Paul,
The error tells you, that the 'Hmisc' does not exist on your system. If you
install it, everything should work.
Use install.packages with dependencies = TRUE to avoid the problem of
missing packages.
HTH
Ulrik
On Thu, 9 Mar 2017 at 16:51 Paul Bernal wrote:
Hello friends,
Has anyone
Hi Hugh,
I believe the recommended way of saving ggplots is through ggsave. It
defaults to take the latest plot displayed, but you can specify which plot
to save by passing the variable to the plot argument.
If you need to save multiple plots in one file, you have to create a
multipage plot using
Hi Elahe,
?mean
in particular the na.rm argument.
HTH
Ulrik
On Thu, 2 Mar 2017 at 11:55 ch.elahe via R-help
wrote:
> Hi all,
>
> The question seems easy but I could not find an answer for it. I have the
> following column in my data frame and I want to take average of the column
> excluding t
Files starting with dots are hidden files on Mac. The emacs configuration
file .emacs should be in your home directory. You can list all files - also
the hidden ones - by `ls -a` in your console. I don't use Mac so I can't
tell you how to show hidden files in Finder.
If you still can't find the fi
Hi Tunga,
The function subset() is probably what you are looking for. You might also
want to look at a tutorial to understand the R syntax.
In addition, calling your data data is not a good idea because of the name
clash with the function data().
Hope this helps,
Ulrik
On Mon, 27 Feb 2017 at 13
Hi Shane,
Wrong forum. This might be what you are looking for
ffmpeg -i %03d.png output.gif
Or use the library gganimate.
Best
Ulrik
Shane Carey schrieb am Di., 14. Feb. 2017, 12:08:
> Hi,
>
> I have many png files that I would like to stitch together, in order to
> make a gif file.
>
> Any
Hi Georg,
maybe someone here knows, but I think you are more likely to get answers to
Rstudio related questions with RStudio support:
https://support.rstudio.com/hc/en-us
Best,
Ulrik
On Thu, 9 Feb 2017 at 12:35 wrote:
> Hi All,
>
> I would like to make a backup of my RStudio IDE options I conf
If you want to use purrr, you could do
fil <- paste0("data",2004:2014,".txt")
map_df(fil, read.table, .id = "fil")
to get everything in one data frame (I assume all files have the same
structure)
HTH
Ulrik
On Wed, 18 Jan 2017 at 16:10 PIKAL Petr wrote:
> Hi
>
> Let me make some assumptions. Y
Hi Maicel,
Please keep the list in CC.
I can't help with read_xml but perhaps someone on the list can.
Best,
Ulrik
On Fri, 6 Jan 2017, 19:03 Maicel Monzon, wrote:
> Hi Ulrik,
>
>
>
> I meant 'read_xmlmap' was a bug. I did what you told me with all the set
> and the error message is:
>
>
>
>
Hi Maicel,
I'm guessing that B works on 50 files, and that A fails because there is no
function called 'read_xmlmap'. If the function that you map work well,
removing 'dplyr::sample_n(50)' from 'B' should solve the problem.
If that is not the case, we need a bit more information.
HTH
Ulrik
On F
1 - 100 of 202 matches
Mail list logo