Dear Arnaud,
I don't quite unterstand why you have imbricated ifelse() statements. Do
you have more that BUY (1) and SELL (-1)? If not, why not simply:
mynewdf2 <- mydf2 |> dplyr::mutate(side = ifelse(side == 'BUY', 1, -1))
That would solve the problem. I'm not quite sure exactly what happens,
Dear David,
simply check str(KD6). My guess (because we don't have your dataset,
only a print of it) is that KD6 is not a matrix but a data.frame. The
problem seems to come from the column "E..coli" which contains commas
instead of periods (so text and not number). There might be other issues
(. ~ RAWMAT, data = my_data[-1], FUN = mean, na.rm = TRUE,
na.action = na.pass)
Cheers,
Ivan
On 04/09/2023 13:56, Rui Barradas wrote:
Às 12:51 de 04/09/2023, Ivan Calandra escreveu:
Thanks Rui for your help; that would be one possibility indeed.
But am I the only one who finds that behavior
= TRUE) to calculate the group stats.
Best wishes,
Ivan
On 04/09/2023 13:46, Rui Barradas wrote:
Às 10:44 de 04/09/2023, Ivan Calandra escreveu:
Dear useRs,
I have just stumbled across a behavior in aggregate() that I cannot
explain. Any help would be appreciated!
Sample data:
my_data
no missing data.
>
> Iago
> ----
> *De:* R-help de part de Ivan Calandra
>
> *Enviat el:* dilluns, 4 de setembre de 2023 11:44
> *Per a:* R-help
> *Tema:* [R] aggregate formula - differing results
> Dear useRs,
&g
row.names = c(1L, 2L, 3L, 4L, 5L, 111L, 112L,
113L, 114L, 115L), class = "data.frame")
aggregate(cbind(EdgeLength, SurfaceArea, Length, Width) ~ RAWMAT, data =
my_data2, FUN = mean, na.rm = TRUE)
aggregate(. ~ RAWMAT, data = my_data2[-1], FUN = mean, na.rm = TRUE)
group_by(my_data2, RAW
Maybe I missed it in the whole discussion, but since R 4.2.0 the base R
pipe operator also has a placeholder '_' to specify where the result of
the left-hand side should be used in the right-hand side (see
https://stat.ethz.ch/pipermail/r-announce/2022/000683.html).
So the only difference in u
much
better than I can.
In any case, once I started using it, I realized that all the pros for
the pipe operator are real and now I like using it!
Best,
Ivan
*LEIBNIZ-ZENTRUM*
*FÜR ARCHÄOLOGIE*
*Dr. Ivan CALANDRA*
**Imaging Lab
MONREPOS Archaeological Research Centre, Schloss Monr
wn in advance and are based on
data contained in another vector. Where that vector comes from is
important too because the whole thing might be unnecessary. Is that
maybe what you were hinting at, Bert?
Maybe Uwe can tell us more about what/why he wants to do!
Ivan
--
Dr. Ivan Calandra
Ima
a value with the same shape as test||".
So, because x[i] == 0 returns a single value (TRUE or FALSE), ifelse
will also return a single value (either A[, i][1] or 0) and not a vector
of length 3 as you wanted. This single value is recycled to fill M[, i],
hence the result.
HTH,
Ivan
--
Dr
In my first trials, I made a typo, which resulted in more columns than
needed in the output of merge, which is why I needed more formatting.
But now, it is indeed done all in one line and it is, as I said already,
nicer anyway!
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological
Dear Jeff,
Thank you for the hint. I had read about it. While it is quite useful, I
doubt that any of my colleagues would understand the construct...
Waiting for the placeholder :)
Best,
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
Thank you Ivan for the info. That's exciting!
Do you also know for which R release it is planned?
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Cal
y we should keep the R mailing list!
My $0.02
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
From: R-help on beha
Dear Luigi,
Quickly, I spot two problems:
1) "09/20/2021" can only be month/day/year (and not day/month/year as
you specified).
2) The year is given with century, so it should be upper case Y
So
as.Date(ori[[n[3]]], format = "%m/%d/%Y")
should work.
HTH,
Ivan
--
Dr. I
Dear Adam,
This would work indeed, but then the default aspect ratio (1.618) would
be used. I could as well calculate the height from the width and aspect
ratio. Unfortunately, this doesn't help me in my case (but as I said, I
have found a workaround).
Thank you again.
Ivan
--
Dr.
ve found a workaround using the package patchwork: I put the plots
together into one plot, that I save on an A4 page.
Best,
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.n
Thank you Adam!
I'm a bit surprised that an extra package is needed for this, but why not!
Best,
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Cal
out it and, as it is, I am not sure it would be
worth the effort. I might be missing some arguments for it, but I would
actually like someone to show me how it could look like - this might
just be what I need to be convinced!
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Resea
including plots and
extra plots as PDF, I cannot use pdf(). That's why I use ggsave().
Or am I missing something?
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/pr
height nor the aspect ratio? If I specify the width
only, the plots are truncated in width because the aspect ratio is not
correct.
Thank you for the tip!
Ivan
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631
Thank you very much Rui!
--
Dr. Ivan Calandra
Imaging lab
RGZM - MONREPOS Archaeological Research Centre
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
On 04/09/2021 18:22, Rui Barradas wrote:
Hello,
The problem is that you
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 1L, 1L, 2L,
t not necessarily or exclusively for other
projects).
Best wishes,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 977
realized this doesn't help much. Then I
tried with MD5 and I thought it was solved, but it was obviously not solved.
Duncan solution seems to work (I have not fully checked yet, though),
but I am really open to other, more robust alternatives.
Thanks for the input!
Ivan
--
Dr. Ivan Calandra
T
Thank you very much Duncan for your help. I'll try that.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 977
place to start.
Or am I missing something (I am still a newbie on these things...)?
Ivan C
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
Thank you Jeff for the pointer.
If it's not an R issue, I guess it will be difficult to solve...
But maybe there is a workaround using R, like using another function or
editing the files...? Does anyone have any idea?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Contr
ould help me sorting it out.
Thank you in advance,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0)
e file, or better a reproducible
example using dput().
For the second part, your syntax was not correct (subsetting a column
for elements based on a column that is not part of the subset!). And
there is no column "pch" in your example. Try:
df3[df3$event == "start", "ev
t received
any other R-related emails. Are there few today or is it just me? There
might even be more answers to my question...
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
is that this facet plot is
part of a patchwork and I would like to have the same number of rows for
all facet plots of the patchwork (so that they all align well).
Is there a way to force the number of rows in the facet_wrap()?
Thank you in advance.
Best,
Ivan
--
--
Dr. Ivan Calandra
TraCEr, l
Thank you Bert, this is wonderful!
Best wishes,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https
OK, my bad... I'm sure I had tried it and it didn't work, but I guess
the error was somewhere else...
Thank you!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evoluti
#x27;s easy using "[", but I expected it would be possible with
select() as well; it would make the code more readable than:
mydata %>%
.[ vector_of_indices ]
Thank you for your help.
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Arch
ength-1 vector. But my
real goal is not to end up with a single value or even a single column.
I just thought that simplifying my example was the best approach to ask
for advice.
But thank you for letting me know that what I'm doing is pointless!
Ivan
--
Dr. Ivan Calandra
TraCEr, labo
hear that I'm using tidyverse the proper way :)
Best regards,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+4
Thank you all for all the very helpful answers!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https
Indeed!
I was just hoping that there would be a shorter way... intersect() is a
nice alternative too. Maybe I can make it work with pipes so that I
don't have to repeat "mydata" but that's another story.
Thank you for the help!
Ivan
--
Dr. Ivan Calandra
TraCEr, laborator
Thank you Bert for the pointer.
So I guess the solution is:
grep("ConfoMap.+GuineaPigs", mydata, value=TRUE)
This is not the case here, but what if "GuineaPigs" comes before
"ConfoMap"?
Of course I could do two "grep()" calls, but if there a better solu
Thank you Eric, I didn't think about intersect().
Now I'm trying to do that in tidyverse with pipes, and I think that's
too much for me for now!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
M
tbl_df", "tbl", "data.frame"))
I want to subset the rows with "a" in the column "files", and keep only
that column.
So I did:
myfile <- mytbl %>%
filter(grepl("a", files)) %>%
select(files)
It works, but I believe there mus
s", mydata, value=TRUE)
it returns an empty vector, character(0).
But if I do:
grep("ConfoMap|GuineaPigs", mydata, value=TRUE)
it returns all the elements that include either "ConfoMap" or
"GuineaPigs", as I would expect.
So what is wrong with my "&"
Thank you again Duncan for the details.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https
installation of
RStudio... Is there a way to identify (and delete, if wished) these
packages?
Or have I misunderstood?
Thank you!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
S
Thank you Duncan for the very detailed and clear answer!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
in code) about
installing packages through RStudio.
In general, it would be nice to have a list of the differences in
behavior between R and RStudio, but I believe this should come from the
RStudio side of things.
Thank you all for the insights.
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for
Hi,
Rather than creating a workbook as suggested by Enrico, you can simply
supply a list to write.xlsx(); each element will be saved in a separate
sheet:
write.xlsx(list(a = df1, b = df2), file = fl_out)
That is not really appending, but that might work for you.
HTH,
Ivan
--
Dr. Ivan Calandra
Dear Petr,
This is not a ggplot2 solution, but you could just remove the NA rows
and drop the levels of vzorek:
met2 <- met[complete.cases(met), ]
met2$vzorek <- droplevels(met2$vzorek)
But I guess you already thought about that...!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Trac
Thanks Rui for these 2 possibilities; I'll have a look.
Any one with pointers for the error bars issue?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Mon
estions/22805/how-to-draw-neat-polygons-around-scatterplot-regions-in-ggplot2
Thank you in advance for any pointer.
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
Dear Hervé,
This is indeed a wise recommendation; I hadn't thought about colnames()
vs. names(), and in general 2D vs. list notations.
I will have to edit a bit more than I thought.
Thank you all for all these hints!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceolog
Thank you Greg for the insights!
I agree with you that the decrease in speed is not worth the decrease in
readability, and I'll change my length() calls to ncol().
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Res
Thanks Jeff,
I was just completely unaware of these options! Now I know.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0
ectory with
the here package. IMHO, this functionality should be more advertised;
this seems to me to be the greatest advantage of using it!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Hu
. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
On 02/04/2020 11:02, Ivan Ca
tter if it could be applied generically.
As I said, ideally, I would like to get the project directory from a
script located in a subfolder.
Thanks!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human B
So what you're saying is that I should have scripts in the project
directory and not in a subfolder within it, right?
But what if I need (or at least want) to?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centr
Hi Jeff,
But if I do not use setwd(), the current working directory is NOT the
project directory.
That's what my problem is about... I guess I was not clear in my email...
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Res
would like to avoid absolute paths of course, but I do not know how to
proceed.
What would be nice is a way to get the project directory in the scripts,
rather than their working directory.
Does that make sense?
Thank you in advance
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceolo
Thanks Matthias for the details!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net
to create unexpected results.
Thank you,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.n
That's exactly why I was asking if it really is equivalent and if there
are issues using one function or the other
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Mon
Thanks Eric,
I know that, but that doesn't really answer my question, does it?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
overrides this behavior.
I still find it strange that my second and third examples behave
differently.
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567
quot;
file.choose() ## unexpectedly, opens in "C:/Users/.../Documents"
setwd("D:/Data")
getwd()
[1] "D:/Data"
file.choose() ## opens in "D:/Data" as expected
Is that normal behavior?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled
Dear Marc,
Thank you, exactly what I needed!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https
?
Thank you in advance.
Best regards,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net
Thank you Bert.
That's more like what I was looking for.
Could you please tell me where I can find information on the "\\1"? This
is the part I still don't get.
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological
Thanks Jeff!
It does indeed make sense that there is no "AND" corresponding to the "|".
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Mo
n to the second problem is actually unfortunately even more
complicated to me than the gsub() solution. But I'm glad I can learn
about regmatches() and regexpr()!
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre an
ders <- c("dist to
origin on curve [mm]","segment on section [mm]", "angle 1 [degree]",
"angle 2 [degree]","angle 3 [degree]") units.var <-
gsub(pattern="^.*\\[|\\]$", "", headers)
It seems to be to overly complic
I have no idea about Tibble...
[Reply to the list if you want helpful answers ;) ]
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
Hi,
I would guess that your data object (matrix, data.frame?) does not have
a column called "Previous_stage".
Maybe you just misspelled it; remember that R is case-sensitive.
Please forgive me if I'm completely off!
HTH,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for
de by 1000.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Caland
ns and "if... else" statements, so I cannot really test it.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0)
t;2019/05/10", "2019/05/10", "#", "#", "#", "2019/05/10", "#", "#", "#",
"2019/05/10", "#", "#", "#", "2019/05/10", "2019/05/10"), V19 =
c("0.2012800083&
I find that the str() function is really helpful to understand how an object is
structured, and therefore how to extract part(s) of it.
Try for example:
str(zz)
and it might help you understand why zz$coefficients[2,1] is what you were
looking for.
HTH
Ivan
--
Dr. Ivan Calandra
TraCEr
inion
of course. I can still convert NaN to NA at the end if I need to.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0)
TRUE) [1]
NAsd(x, na.rm=TRUE) [1] NA
Thanks for any feedback.
Best,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-2
Hi!
In those cases, I use R.utils::saveObject() and loadObject().
You would have to save each object separately though:
saveObject(x1, file="file.Rbin")
y <- loadObject(file="file.Rbin")
HTH
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controll
I'm not sure though why one would need that. Why not use lists in that case?
Thanks!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, German
Just for my understanding:
Is a data.frame with list columns still a data.frame? Isn't it then a list?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
Using which() to subset t$id should do the trick:
sapply(levels(t$A), function(x) t$id[which(t$A==x)])
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
Hi Massimo,
Something along those lines could help you I guess:
t$A <- factor(t$A)
sapply(levels(t$A), function(x) which(t$A==x))
You can then play with the output using paste()
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeologi
; in 'plot.formula'), although the
ggplot() function doesn't seem to have it.
In any case, I would recommend you spend some time learning that aspect,
as you will always need it in one situation or another.
HTH,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and C
Good one, did not even notice that...!
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net
Hi Roberto,
This often happens when there are some non-numeric characters. You would
have to check it.
Without more information, e.g. dput(dat), you will have to find by yourself.
HTH,
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS
It's always good to start a new session when you don't understand what's
wrong, because sometimes your code is correct, but you use old data
without knowing it :)
Ivan
--
Dr. Ivan Calandra
TraCEr, Laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Rese
Hi,
Check the FAQ 7.31
https://cran.rstudio.com/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f
And read the posting guide too...
https://www.r-project.org/posting-guide.html
HTH,
Ivan
--
Dr. Ivan Calandra
TraCEr, Laboratory for Traceology and Controlled Experiments
within the square brackets, the vector before
the comma indexes the rows and the one after the comma indexes the columns.
The other thing you were missing correctly referencing the rows. You
have to specify the data.frame you want to look into.
And last, learn to use dput() to provide a nice repro
ation...?!
Another oddity is the legend of the SAS output, which does not
correspond to the data in the output itself (but corresponds to the R
values with correct=TRUE)!
Could the SAS documentation have some errors? I don't have SAS installed
so cannot test the code.
Ivan
--
Dr. Ivan Ca
Hi Jamil,
You first need to specify 'xaxt' and 'yaxt' in your plot() call, and
then you can set the size of the labels with cex.axis:
plot(x, y, xlab=expression(vartheta), ylab="Concentration", xaxt="n",
yaxt="n")axis(1, cex.axis=3) axis
Hi Nabila,
This is because you ask to create a sequence with seq(), which does not
make much sense with non numeric data. That's why R trims the 0.
One alternative would be:
seq2 <- paste("DQ0", seq(60054, 60060), sep = "")
Would that work for you?
HTH,
Ivan
--
Ivan
--
Ivan Calandra, PhD
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
calan...@rgzm.de
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra
https://rgzm.academia.edu/IvanCalandra
https://publons.com/a
("Equipment", "Spot", "Measurement",
"Value"), row.names = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L,
22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 101L, 102L, 103L, 104L, 105L, 106L, 107L, 108L, 109L, 110L,
Hi Georg,
Not sure how it would work in your case, but the 'local' argument to
source() is not only TRUE or FALSE; you can also specify an environment.
HTH,
Ivan
--
Ivan Calandra, PhD
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monr
at=datf$Sample2, labels=datf$Sample)
It might not be the easiest/best approach though... Someone here might
have a better idea.
HTH,
Ivan
--
Ivan Calandra, PhD
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
calan...@rgz
Hi,
Not sure, but it seems that your function equal() is exactly what
all.equal() does, isn't it?
Ivan
--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...
1 - 100 of 622 matches
Mail list logo