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
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
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
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
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
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
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
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.
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
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
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
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:
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
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
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
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
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)
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
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 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 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 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 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 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
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
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
>
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<
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
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
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 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
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 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
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 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 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
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 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)
>
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 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 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
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 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
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
>
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 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
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 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,
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(
; 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 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
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
;% 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"
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
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:
>
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 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,
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_
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 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
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 Chalabi,
Maybe you can use ddply to look over the intervals and add the means as new
colum
Best wishes
Ulrik
David Winsemius schrieb am Sa., 21. Mai 2016 17:16:
>
> > On May 21, 2016, at 7:41 AM, ch.elahe via R-help
> wrote:
> >
> > Hi all,
> >
> > Here is my df and I want to make an avera
Hi Elahe,
maybe this will help:
http://stackoverflow.com/questions/6455088/how-to-put-labels-over-geom-bar-in-r-with-ggplot2
or this:
http://stackoverflow.com/questions/12018499/how-to-put-labels-over-geom-bar-for-each-bar-in-r-with-ggplot2
Best,
Ulrik
On Fri, 27 May 2016 at 15:12 ch.elahe via R
uot;ch.elahe via R-help" <
> r-help@r-project.org> wrote:
>
>> Thanks Ulrik,
>> But in these examples they want to mark the percentage or frequency of plot
>> variables, in my case I want to mark the bars with a different variable of
>> my df. DO you have any
use gsub()
On Fri, 27 May 2016 at 17:12 Jun Shen wrote:
> Dear list,
>
> Say I have a data frame
>
> test <- data.frame(C1=c('a,b,c,d'),C2=c('g,h,f'))
>
> I want to replace the commas with semicolons
>
> sub(',',';',test$C1) -> test$C1 will only replace the first comma of a
> string.
>
> How do
or your reply.
>
> gsub worked for one column!
>
> If I want to replace the whole data frame, gsub doesn't seem to work. Any
> idea
>
> On Fri, May 27, 2016 at 11:14 AM, Ulrik Stervbo
> wrote:
>
>> use gsub()
>>
>> On Fri, 27 May 2016 at 17:12 Jun Sh
Hi Val,
Take a kook at read.table. If for some reason the file dosen't have the
same separator between the columns you can use strsplit after loading the
file.
This might helpyou along getting data into R:
http://www.statmethods.net/input/importingdata.html
Best
On Tue, 31 May 2016, 02:15 Val,
Hi Elahe,
if you look at your subdf, you will see that the column Country - which is
not numeric - is still present. You might have other non-number columns,
but this I cannot tell.
scale expects a numeric matrix. You give it a data.frame which is silently
cast to a matrix. A matrix can only have
Hi Ed,
I'm not sure I understand, but can't you rwad the files one by one and
create one data.frane using rbind?
Is easy to put do in a loop too.
Best wishes,
Ulrik
On Thu, 2 Jun 2016, 20:23 Ed Siefker, wrote:
> I have many data files named like this:
>
> E11.5-021415-dko-1-1-masked-bottom-a
You can use ldply in the plyr package to bind all the data.frames together
(a regular loop will also work). Afterwards you can summarise using ddply
Hope this helps
Ulrik
Ed Siefker schrieb am Fr., 3. Juni 2016 21:10:
> aggregate isn't really what I want. Maybe tapply? I still can't get
> it
Hi Michu,
What document type do you generate? I usually make just html and have no
problems. If you create a pdf, please remember this is done through LaTeX
and your problem could arise from the floats of LaTeX.
For other output I have no idea.
Hope this helps
Ulrik
Michu Kom schrieb am Mo., 6
> having mixed sections and plots.
>
> Thank you for your advice,
> Michu
>
> 2016-06-06 10:04 GMT+02:00 Ulrik Stervbo :
>
>> Hi Michu,
>>
>> What document type do you generate? I usually make just html and have no
>> problems. If you create a pdf, please r
Dear Shashi,
I don't see any code, but I will take a guess anyway:
The error tells you that you try to compare a boolean with something that
is not (TRUE or FALSE cannot be compared to NA).
HTH
Ulrik
On Thu, 9 Jun 2016 at 08:55 SHASHI SETH wrote:
> Hi,
>
>
>
> I am getting the following error
How do you merge the two data.frames? Could it be that you make an outer
join?
HTH
Ulrik
On Thu, 9 Jun 2016 at 19:45 Michael Dewey wrote:
> Perhaps I do not understand you correctly but why not create a variable
> for the id before you merge?
>
> On 09/06/2016 09:00, 周 可卫 wrote:
> > I got the d
Hi Patrizio,
maybe there is a more efficient way, but you can loop over rows and columns
like this
ab.recon <- data.frame()
ddd.rownames <- rownames(ddd)
ddd.colnames <- colnames(ddd)
for(cur.row in ddd.rownames){
for(cur.col in ddd.colnames){
times.found <- ddd[cur.row, cur.col]
tmp.
I don't know about R for this but how about wget:
http://www.createdbypete.com/articles/simple-way-to-find-broken-links-with-wget/
You could store the list of links in a file and additionally use the -i
flag.
HTH
Ulrik
On Tue, 21 Jun 2016 at 16:47 Jenny Vander Pluym - NOAA Federal <
jenny.vander
It looks like the function you are searching for is merge()
HTH
Ulrik
On Wed, 29 Jun 2016 at 15:11 ch.elahe via R-help
wrote:
> Hi all,
> I have this column as a part of df:
>
> $License : Factor W/384 levels
> "41005","41006","41034","41097","41200",...
> and I have other column which is
; On Wednesday, June 29, 2016 3:35 PM, Ulrik Stervbo <
> ulrik.ster...@gmail.com> wrote:
>
>
>
> It looks like the function you are searching for is merge()
>
> HTH
> Ulrik
>
>
> On Wed, 29 Jun 2016 at 15:11 ch.elahe via R-help
> wrote:
>
> Hi all,
Vince Buffalo has covers this nicely in his book "Bioinformatics Data
Skills". The original data should stay the original data is immutable and
Vince then suggests that you have a text file in your data directory where
you explain where the data came from and which scripts you used to create a
modi
Hi Giles,
Look at ?mean
In addition it seems you need to read a few tutorials on R. Several are
already mentioned on this list otherwise Google can direct.
Hope this helps,
Ulrik
Giles Bischoff schrieb am Fr., 1. Juli 2016 18:55:
> So, I uploaded a data set via my directory using the command
Hi Lily,
you can use gsub:
df$ID <- gsub("_.*", "", df$ID)
HTH
Ulrik
On Sun, 3 Jul 2016 at 20:16 lily li wrote:
> I have a problem in changing row names in a dataframe in R. The first
> column is ID, such as aClim_st02, aClim_st03, aClim_st 05, bClim_st01,
> bClim_st02, etc. How to rename the
,df$ID), but it does not work.
>
>
> On Sun, Jul 3, 2016 at 12:24 PM, Ulrik Stervbo
> wrote:
>
>> Hi Lily,
>>
>> you can use gsub:
>>
>> df$ID <- gsub("_.*", "", df$ID)
>>
>> HTH
>> Ulrik
>>
>> On S
s characters after using the gsub function.
> What is the problem? Thanks again.
>
>
> On Sun, Jul 3, 2016 at 12:41 PM, Ulrik Stervbo
> wrote:
>
>> Hi Lily,
>>
>> My suggestion should remove the underscore and everything after it,
>> leaving just aClim
If you want the total number of rows in the original data.frame after
counting the rows in each group, you can ungroup and sum the row counts,
like:
library("dplyr")
mtcars %>%
group_by (am, gear) %>%
summarise (n=n()) %>%
mutate(rel.freq = paste0(round(100 * n/sum(n), 0), "%")) %>%
That will give you the wrong result when used on summarised data
David Winsemius schrieb am Di., 5. Juli 2016 02:10:
> I thought there was an nrow() function?
>
> Sent from my iPhone
>
> On Jul 4, 2016, at 9:59 AM, Ulrik Stervbo wrote:
>
> If you want the total number of
Yes. But in the sample code the data is summarised. In which case you get 4
rows and not the correct 32.
On Tue, 5 Jul 2016, 07:48 David Winsemius, wrote:
> nrow(mtcars)
>
>
> Sent from my iPhone
>
> On Jul 4, 2016, at 9:03 PM, Ulrik Stervbo wrote:
>
> That will give y
Hi Georg,
Your problem with the geom_text was that you tried to count Var1 in some
bins which cannot be defined on characters - the counts you really wanted
to use are in Anzahl. This should do what you want:
library(ggplot2)
freq_ls <- structure(list(Var1 = c("zldkkd", "aakdkdk","aaakdkd",
"aai
Hi Elahe,
Use subset and the %in% operator:
subset(df2, Serial %in% Matched)[["Count "]]
Best wishes,
Ulrik
On Thu, 7 Jul 2016 at 13:37 ch.elahe via R-help
wrote:
> Hi all,
> I have 2 data frames like the following:
> the first one df1:
>
> 'data.frame': 141obs. of 1 variable:
> $Ser
Hi Ken,
You can use coord_cartesian() to set axis. Or if it makes sense to your
problem you can facet your plot.
Hope this helps
Ulrik
KMNanus schrieb am Di., 12. Juli 2016 01:35:
> I’m plotting few dozen variables, doing so because I need to examine them
> one at a time. The range of these v
Dear Dagmar,
must the numberdata be character?
Here are tew solutions. The first solution summarise before plotting and
the second does everything in the plot
library("dplyr")
library("ggplot2")
datframe <- data.frame(Name=c("Kati","Kati","Kati","Leon","Leon","Leon"
), week =c("1","2", "3", "1",
What you show cannot be a data.frame. Using what you gave, this should help
you along:
x <- c(11,15,12,25, 11,12, 15,25, 134,45,56, 46, 45,56, 15,12,
66,45,56,24,14,11,25,12,134)
table(x)
On Wed, 20 Jul 2016 at 11:44 Jim Lemon wrote:
> Oops, didn't translate that function correctly:
>
> has_val
The easiest might be to download the entire dataset and filter it
appropriately. If I follow your link and press Download, I get the option
to "Download Complete NAV Report in Text Format" and will result in this:
http://portal.amfiindia.com/NAVReport.aspx?type=0
It is not the easiest format to ge
I am aware of that link and this is a
> good option. However with this approach, I can not get Data
> historically. I would like to create some TS in R for each MF there.
>
> Any other idea?
>
> Thanks,
>
> On Tue, Jul 26, 2016 at 12:53 AM, Ulrik Stervbo
> wrote:
> &g
Hi Georg,
excel.link and installr: as far as I can tell from CRAN, excel.link and
installr are for windows OS only
1-5: you are installing packages that are wrappers to system
function/programms. They must be present on your system first.
2: Maybe Weka is missing in the path? Is your java excutab
Hi Georg,
it's hard to tell without a reproducible example.
Should spread really merge elements? Does spread know anything about
CustID? Maybe you need to make a useful key of the CustIDs first and spread
on that?
Maybe I'm all off, because I'm really just guessing.
Best,
Ulrik
On Thu, 28 Jul
Hi Stefan,
in that case,lapply(data, length) should do the trick.
Best wishes,
Ulrik
On Thu, 28 Jul 2016 at 12:57 Stefan Kruger wrote:
> David - many thanks for your response.
>
> What I tried to do was to turn
>
> data <- list(one = c(1, 1), three = c(3), two = c(2, 2))
>
> into
>
> result <-
into wide
> form and keep all but missing value information.
>
> Did I explain my problem in a comprehensible way? Are there any further
> questions?
>
> Kind regards
>
> Georg
>
>
>
>
>
> Von:Ulrik Stervbo
> An: g.maub...@weinwolf.de, r-help@
Hi Jake,
maybe you can just revet the colours given to the scale:
scale_colour_gradientn(colours = rev(rainbow(5.5)))
Best,
Ulrik
On Tue, 2 Aug 2016 at 16:41 Jake William Andrae
wrote:
> Hello,
>
> This is my first time posting to the r-help mailing list and I'm a
> relative amateur using R,
You could use dplyr:
library(plyr)
ddply(df, .variables = "year", summarise, mean.precip = mean(precip))
Hope this helps
Ulrik
On Wed, 3 Aug 2016 at 17:29 lily li wrote:
> I meant that my dataframe has daily data, but how to plot annual mean/sum
> directly? Thanks.
>
> On Wed, Aug 3, 2016 at
Not quite - this works: rbind(df1, df2, df3, df1, df2, df3)
Or if the have your data.frames in a list, use do.call:
df.lst <- list(df1, df2, df3, df1, df2, df3)
do.call(rbind, df.lst)
You might take a look at the facet functionality in ggplot once you are
ready to build your plots.
Best,
Ulrik
1 - 100 of 202 matches
Mail list logo