olddata$first <- as.numeric(! duplicated(olddata$ID))
:-)
> On Nov 30, 2024, at 22:27, Sorkin, John wrote:
>
> ID <- c(rep(1,10),rep(2,6),rep(3,2))
> date <- c(rep(1,2),rep(2,2),rep(3,2),rep(4,2),rep(5,2),
> rep(5,3),rep(6,3),rep(10,2))
> olddata <- data.frame(ID=ID,date=date)
>
Ah - that's an excellent point. Thanks.
> On Oct 28, 2023, at 14:54, Jeff Newmiller wrote:
>
> as.data.frame is a _converter_, while data.frame is a _constructor_.
> Changing the object contents is not what a conversion is for.
>
> On October 28, 2023 11:39:
ally need the data.frame created in a single
> statement or can you change the column names next as in:
>
>
>> nouns
> V1 V2
> 1 gagglegeese
> 2 duledoves
> 3 wake vultures
>> colnames(nouns)
> [1] "V1" "V2"
>> co
I have been trying to create a data frame from some structured text in a single
expression. Reprex:
nouns <- as.data.frame(
matrix(c(
"gaggle",
"geese",
"dule",
"doves",
"wake",
"vultures"
), ncol = 2, byrow = TRUE),
col.names = c("collective", "category")
the gauge displays 2320.
> I'm not sure why this occurs. Changing the statement to 56, results in the
> gauge reading 60. I'm not sure what needs to be changed in the script or the
> environment to stop rounding.
> On Jul 22, 2023, at 10:43, Boris Steipe wrote:
>
>
What do you mean "Rounded"?
What do you expect, what do you get instead?
?
> On Jul 22, 2023, at 10:40, Thomas Subia via R-help
> wrote:
>
> Colleagues,
> Thanks for the update.
> My colleagues at work have run this script but the resulting graph output for
> value is rounded. How can one
Since it is 2023, I asked that question to ChatGPT-4 and got the following
response.
-
The `plotly` library in R uses the `gauge` argument inside the `plot_ly`
function to specify the properties of the gauge plot. You can change the
indicator color of the arc (also know
This was actually the first thing that ChatGPT debugged for me.
The issue was that I was able to click on the link when I displayed the raw SVG
in the browser (you can use that to test whether the syntax is even correct),
but not when the svg displays inside a html page with the tag.
ChatGPT c
84%7C0%7C0%7C638107722117850198%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fGQmH7ad%2BtaJdZU4jenuac%2B46daPUmruBJp4ThoO7GM%3D&reserved=0>
>> PLEASE do read the posting guide
> http://www.R-project.org/postin
It's a new editor feature: see the release notes:
https://dailies.rstudio.com/version/2022.12.0+353.pro20/
• Code editor can show previews of color in strings (R named colors e.g.
“tomato3” or of the forms “#rgb”, “#rrggbb”, “#rrggbbaa”) when Options > Code >
Display > [ ] enable preview of name
ohn
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, mi
line to "concoction" - i.e. an actual academic offence ...
Best,
Boris
> On 2022-12-19, at 03:58, Milan Glacier wrote:
>
> [You don't often get email from n...@milanglacier.com. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
>
&
05:52, Milan Glacier wrote:
> On 12/18/22 19:01, Boris Steipe wrote:
> >Technically not a help question. But crucial to be aware of, especially for
> >those of us in academia, or otherwise teaching R. I am not aware of a
> >suitable alternate forum. If this does not interest
at's even more OT :-)
----
If you have thoughts to share how your institution is thinking about academic
integrity in this situation, or creative ideas how to integrate this into
teaching, I'd love to hear from you.
All the best!
B
??? t() is the transpose function. It just happens to return your list
unchanged. The return value is then printed to console if it is not assigned,
or returned invisibly. Transposing your list is probably not what you wanted to
do.
Returned values do not get printed from within a loop or from
I would not be optimistic about a change - the naming scheme is a community
standard, and the community is VERY large; this scheme is employed in thousands
of software assets. Ultimately it goes back to X11 color naming in the
eighties. See: https://en.wikipedia.org/wiki/X11_color_names for deta
tmp <- function(s) {
return(str(s))
}
key <- "-"
tmp(key)
# chr "-"
... works for me.
Reprex?
Cheers,
Boris
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
You really don't need to worry about all those packages in the beginning. Base
R has all of the functionality you need to get you started. Then, when you
actually need additional functions, you can search for this functionality on
the Web, on CRAN, by asking on this helpful list, or on your favo
e
> length one list
>
> as.character(list(s = c("xyz", "uvw"))
>
> to return the length 2 character vector `c("xyz", "uvw")`? What should
>
> as.character(list(s = c("xyz", "uvw"), t = c("a", "b", "c&
I was just surprised by very un-intuitive behaviour of paste(), which appears
to collapse a one-column data frame or one-element list into a deparsed
expression, rather than producing the expected string. Can someone kindly
explain what's going on here?
reprex:
===
list(s = c("xyz", "uvw"
prevents it from applying the formula to another data set.
>
> Hope that helps,
> Achim
>
>
>>> On 4 Nov 2020, at 10:50 , Boris Steipe wrote:
>>>
>>> Can't get data from a data frame into predict() without a detour that seems
>>> quite unne
Can't get data from a data frame into predict() without a detour that seems
quite unnecessary ...
Reprex:
# Data frame with simulated data in columns "h" (independent) and "w"
(dependent)
DAT <- structure(list(h = c(2.174, 2.092, 2.059, 1.952, 2.216, 2.118,
1.755, 2
To draw a curve, the function that will be used in
> curve() sets up a newdata dataframe and passes it to predict(fit,
> newdata= ...) to get predictions at those locations.
>
> Duncan Murdoch
>
> On 17/10/2020 5:27 a.m., Boris Steipe wrote:
>> I'm drawing a fitted n
(sig*sqrt(2*pi)) * exp( (-1/2)*((x-mu)/sig)^2 )
}
# ... and add the curve:
curve(mF(x),
from = par("usr")[1], to = par("usr")[2],
col = "#FF55", lwd = 2, add = TRUE)
# But what I would like to do is something much more general, like:
curve(myFit$
I totally agree with Roy, thank you.
I hope that we can get the discussion back on OP's question (which is timely
and very important, and actually not specific to the IDE).
The problem is that our possibilities to test user experience are usually
limited. AFAIK students could be participating v
The c() is unnecessary. paste() returns a vector.
Paste separates elements with " " by default. Set the separator to "" instead.
paste("c",1:10, sep = "")
... or use paste0(), which has "" as default separator.
paste0("c",1:10)
?paste is your friend.
B.
> On 2020-05-23, at 22:25, Vahid Bo
See my response to the C++ question you posted a minute later.
B.
> On 2019-12-15, at 05:35, Александр Дубровский wrote:
>
> # Iterative Merge sort (Bottom Up)
>
> # Iterative mergesort function to
> # sort arr[0...n-1]
> def mergeSort(a):
>
>current_size = 1
>
># Outer loop for t
See this thread why that's a bad idea ...
https://stackoverflow.com/questions/26080716/merge-sort-in-r
... and use the code given there, or give us some context why a literal
translation would be important to you.
Cheers,
Boris
> On 2019-12-15, at 05:37, Александр Дубровский wrote:
>
> /*
know that is about 2 rows
> which are non unique. But I would like to extract all 8 columns for those non
> unique rows and see what is going on with META value I have in them.
>
> About duplicated() function I know as well as about unique
>
> On Fri, 8 Nov 2019 at 10:08,
Are you trying to eliminate duplicated rows from your dataframe? Because that
would be better achieved with duplicated().
B.
> On 2019-11-08, at 10:32, Ana Marija wrote:
>
> would you know how would I extract from my original data frame, just
> these unique rows?
> because this gives me on
(Technically you are now thread-hijacking. But here goes:)
mydf <- data.frame(V11 = c("DD Pack0.002",
"FTA English News0.003",
"FTA Complimentary0.004"),
stringsAsFactors = FALSE)
# regex matching start-of-string(letters or
I've seen that behaviour with a C" atom in a chemical structure.
Here is code to identify lines with an uneven number of quotation marks. Read
your file with readLines() to use it.
myTxt<- '"This" "is" "fine"'
myTxt[2] <- '"This" "is "not"'
myTxt[3] <- 'This is ok'
x <- lengths(regmatches(
ed <- as.POSIXlt("2018-03-10")
sd <- as.POSIXlt("2018-02-10")
as.numeric(ed-sd)
[1] 28
ed <- as.POSIXlt("2000-03-10")
sd <- as.POSIXlt("2000-02-10")
as.numeric(ed-sd)
[1] 29
Cheers,
B.
> On 2019-05-22, at 17:43, reichm...@sbcglobal.net wrote:
>
> R Help
>
> I have a function to calculate a da
ng to do with the ^ or with the space after the
> } and before the (, as in
>
>> {3} (\\w+
>
No. Just the parentheses.
> Back to earlier:
>
>> The rest of the line is not substituted and appears as-is.
>
> Is that due to the space after the \\2? in
>
>> &
he {8}. Hu. So, then, any
> number with : for 8 characters, followed by any two words separated by
> a space and enclosed in <>. And then the \\s* is followed by a single
> space? Or maybe it puts space on both sides (on the side of the #s to
> the left, and then the comment to
les like in this example here below :
>
> library(lme4)
> mm=lmer(Mark ~Gender + (1 | School / Class), data=Dataset)
>
> With your R code, how can I write the lmer function to make it work ?
>
> Best,
> S.
>
>
>
>
>
>
>
> Le dimanche 19 mai
data structure more thoroughly,
> ideally with example.
>
> Thanks,
> Lei
>
> On Sat, May 18, 2019 at 10:04 PM varin sacha via R-help
> wrote:
>>
>> Dear Boris,
>>
>> Yes, top-down, no problem. Many thanks, but in your code did you not forget
&g
e are other
possibilities, you need a different strategy. In NLP there is no
one-approach-fits-all.
To validate the structure of the names in your transcripts, you can look at
patt <- " <.+?> " # " "
m <- regexpr(patt, c)
unique(regmatches(c, m))
B.
*(.*$)",
> + c, proto=data.frame(stringsAsFactors=FALSE, When="", Who="",
> + What=""))
>> head (d)
> When Who What
> 1
> 2
> 3
> 4
> 5
> 6
>
> I've
Can you build your data top-down?
schools <- paste("s", 1:6, sep="")
classes <- character()
for (school in schools) {
classes <- c(classes, paste(school, paste("c", 1:5, sep=""), sep = "."))
}
pupils <- character()
for (class in classes) {
pupils <- c(pupils, paste(class, paste("p", 1:10,
Don't start putting in extra commas and then reading this as csv. That approach
is broken. The correct approach is what Bill outlined: read everything with
readLines(), and then use a proper regular expression with strcapture().
You need to pre-process the object that readLines() gives you: rep
If the script is originally in a file. I use ...
myScript <- readLines()
# [...] modify the myScript vector
writeLines(myScript, con = )
If this is not what you mean, perhaps you can describe your intended workflow
more explicitly.
Cheers,
B.
> On 2019-05-10, at 09:42, Robert Baer wrote:
>
oks rather meta....
>
> On April 21, 2019 10:40:27 PM PDT, Boris Steipe
> wrote:
>> Yes, that's where I started - the vignette says:
>>
>> ... Run arbtirary R code with @eval.
>>
>> ... the @eval tag. It evaluates code and treats th
ut did you read the vignette [1]? It sounds like it is
> a bit more meta than you think it is...
>
> [1] https://cran.r-project.org/web/packages/roxygen2/vignettes/rd.html
>
> On April 21, 2019 7:44:17 PM PDT, Boris Steipe
> wrote:
>> Playing with Roxygen
rt, survival
>
> ***Does it matter that the packages above are unable to be updated? For
> insight, I am trying to generate linear regression models that model
> expression of methylation w/ in a TCGA dataset.***
>
> Best,
>
> Spencer
>
> On Sun, Apr 21, 2019 at
This is unrelated to the question on the subject line, we call this "thread
hijacking" and that's one of the Things Not To Do. Post a new question.
I just wanted to give you the proper incantation for Bioconductor packages. As
you already know, don't use bioclite(), which needed to be sourced fr
Playing with Roxygen features, but can't get @eval to work. E.g. ...
#' @eval sprintf("%s", Sys.time())
... does not do what I thought it would (i.e. substitute the tag and the
expression with the string). Instead I see nothing in the .RD file.
Any working examples out there?
Thanks!
Boris
___
For similar tasks I usually write a while loop operating on a queue.
Conceptually:
initialize queue with first page
add first url to harvested urls
while queue not empty (2)
unshift url from queue
collect valid child pages that are not already in harvested list (1)
add to harvested list
As there are many possible sources of the warning, to "sort it out" try
something like
which( is.na() & (! is.na()))
B.
> On 2019-04-09, at 11:02, Richard M. Heiberger wrote:
>
> My guess is that numbers formatted with commas are causing an unwanted
> coercion.
> Remove the commas with
You need to spend more time getting clear on the fundamentals, what the
Bioconductor project is and why its packages are useful in our domain.
Bioconductor packages are not installed with the install.packages() function;
that is for packages on CRAN. Instead, you use ...
install.packages("Bio
se.deletion = FALSE,
> variance = FALSE)
> Dist <- as.numeric(Dist)
>
> Data1 <- merge(Data1, Dist)
> }
>
> hist(Data1, prob=TRUE)
>
>
> In the last code, the file Data1 (where I want all the data from the 3 files)
> is empty at the end
Myriam -
This is the right list in principle, all the packages you use are CRAN
packages, not Bioconductor.
However I am at a loss as to how you wrote your code: both pegas and seqinr
have "read.()" functions, but neither has read.dna(); similarly both
pegas and seqinr have "dist.()" functions
Use round() with the appropriate "digits" argument. Then use unique() to
define your groups.
HTH,
B.
> On 2018-11-15, at 11:48, sasa kosanic wrote:
>
> Dear All,
>
> I would very much appreciate the help with following:
> I need to calculate the mean of different lat/long points that shoul
Use the %in% operator:
help('%in%')
e.g.
R > c("d", "v", "4", "s") %in% letters
[1] TRUE TRUE FALSE TRUE
B.
> On 2018-08-13, at 23:36, Deepa wrote:
>
> Hi Don,
>
> When there is a list of identifier names that I want to check, the only way
> is to loop over each entry stored in the lis
Maybe the Bioconductor package "intansv" can help you. You asked for linear
chromosomes, but such data is commonly plotted in Circos plots as e.g. with the
Bioconductor OmicsCircos package (cf.
https://bioconductor.org/packages/devel/bioc/vignettes/OmicCircos/inst/doc/OmicCircos_vignette.pdf)
H
Wasn't there also the requirement that the numbers be drawn from a uniform
distribution? These sequences are not. I wonder whether this can for all
practical purposes be simplified to consider only the sequence with maximum
entropy.
B.
> On 2018-07-11, at 06:23, Rolf Turner wrote:
>
> On
o do it?
>
> Thanks again!
>
> Maija
>
> 2018-06-13 15:52 GMT+03:00 Boris Steipe :
> Q[j-2] gives you Q[0] in your first inner loop iteration.
> R arrays start at one.
>
> B.
>
>
> > On 2018-06-13
Q[j-2] gives you Q[0] in your first inner loop iteration.
R arrays start at one.
B.
> On 2018-06-13, at 07:21, Maija Sirkjärvi wrote:
>
> Amat[J-1+j-2,j-1]= 1/(Q[j] - Q[j-1]) + 1/(Q[j-1] - Q[j-2])
__
R-help@r-project.org mailing list -- To UNSUBSC
Interesting problem.
I would discretize the x-values and interleave them. Lines from one dataset
still overlap, so you see high- density and low-density regions, but lines from
the other dataset are drawn into the interval. Like so:
interleave <- function(x, MIN, MAX, N, nChannel = 2, channel)
Just for completeness: there are several ways to open files for editing in
RStudio -
* Configure your computer to be able to double-click on a file and open it
in RStudio: this is OS dependent. Google for "change file associations"
to get advice.
* Drag and drop a file icon onto the RStu
If one is equal to the reverse of another, keep only one of the pair.
B.
> On Mar 29, 2018, at 9:48 PM, Ranjan Maitra wrote:
>
> Dear friends,
>
> I would like to get all possible arrangements of n objects listed 1:n on a
> circle.
>
> Now this is easy to do in R. Keep the last spot fixed
ust
> cause trouble.
>
> -pd
>
>> On 21 Mar 2018, at 18:05 , Boris Steipe wrote:
>>
>> Surely the result of summation of non-existent values is not defined, is it
>> not? And since the NA values have been _removed_, there's nothing left to
>> sum ov
you cannot compute on NULL so no, that doesn't
> work.
>
> See the note under the "Value" section of ?sum as to why zero is returned
> when all inputs are removed.
> --
> Sent from my phone. Please excuse my brevity.
>
> On March 21, 2018 9:03:29 AM PDT, Bor
Should not the result be NULL if you have removed the NA with na.rm=TRUE ?
B.
> On Mar 21, 2018, at 11:44 AM, Stefano Sofia
> wrote:
>
> Dear list users,
> let me ask you this trivial question. I worked on that for a long time, by
> now.
> Suppose to have a data frame with NAs and to sum so
R > rowMeans(roop)
[1] 1.67 5.33 3.00
R > mean(as.numeric(roop[1,]))
[1] 1.67
:-)
> On Mar 20, 2018, at 10:18 PM, Sorkin, John wrote:
>
> I am trying to get the mean of a row of a data frame. My code follows:
>
>
> roop <- data.frame(x=c(1,2,3),y=c(4,5,2),z=c(0,9,4))
> roo
good with R software.
> Since I will be using R in my thesis, it will be helpful if there are R codes
> available for that computation.
> Can I get your help for this, Sir?
>
>
> Joy Mae
>
> On Thu, Feb 22, 2018 at 4:08 AM, Boris Steipe
> wrote:
> If you are
If you are talking about the "Supporting Information" - that contains only one
small piece of matlab code that looks pretty trivial to translate if necessary.
The rest are R scripts.
What then is the problem you need to solve?
B.
> On Feb 21, 2018, at 9:37 AM, JoyMae Gabion
> wrote:
>
> D
I haven't been able to reproduce this because you posted in HTML and no data
arrived. Use the dput() function if you want to post data.
But: a frequent and trivial reason for disappearing category labels is that the
plot window is too small to print them all. Try increasing the plotting window,
You can either use positive lookahead/lookbehind - but support for that is a
bit flaky. Or write a proper regex, and use
backreferences to keep what you need.
R > x <- "abc 1,1 ,1 1, x,y 2,3 "
R > gsub("(\\d),(\\d)", "\\1.\\2", x, perl = TRUE)
[1] "abc 1.1 ,1 1, x,y 2.3 "
B.
> On Feb 12, 20
I have noticed that when I iterate permutations of short vectors with the same
seed, the cycle lengths are much shorter than I would expect by chance. For
example:
X <- 1:10
Xorig <- X
start <- 112358
N <- 10
for (i in 1:N) {
seed <- start + i
for (j in 1:1000) { # Maximum cycle length to c
gt; AllMAFs[[i]] <- apply( SeparatedGroupsofmealsCombs[[i]], 2,
> function(x)maf( tabulate( x+1) ))
>
> refers to a variable "i" that has never been defined.
>
> Duncan Murdoch
>
>>
>>
>> The lapply function :
>> results<-lapply(Separ
gives this error :-
> Error in FUN(left, right) : non-numeric argument to binary operator
>
> I have been trying since yesterday but but until now I'm not able to identify
> the correct syntax.
>
>
>
>
> From: David Winsemius
> Sent: 18 November 2017 20:06:56
&
gt;
> when I run this code as before :-
>
> maf <- apply(SeparatedGroupsofmealsCombs, 2, function(x)maf(tabulate(x+1)))
>
> an error message says : dim(X) must have a positive length . I'm not sure
> which length
> I need to specify.. any suggestions to correc
Combine columns 1 and 2 into a column with a single ID like "33.55", "44.66"
and use split() on these IDs to break up your dataset. Iterate over the list of
data frames split() returns.
B.
> On Nov 17, 2017, at 12:59 PM, Allaisone 1 wrote:
>
>
> Hi all ..,
>
>
> I have a large dataset of
Large packages sometimes mask each other's functions and that creates a
headache, especially for teaching code, since function signatures may depend on
which order packages were loaded in. One of my students proposed using the idiom
<- ::
... in a preamble, when we use just a small subset of
t; Election speech) in one single TEXT document, and i want to find the
> association of the top 3 most frequently occurring words with the other
> words in the speech, what method do I adopt ?
>
> On Wed, Nov 15, 2017 at 7:08 PM, Boris Steipe
> wrote:
>
> > If you co
If you consider the definition of a DTM, and that findAssoc() computes
associations between words as correlations across documents(!), you will
realize that you can't what you want from a single document. Indeed, what kind
of an "association" would you even be looking for?
B.
> On Nov 15, 20
|> x <- sample(0:2, 10, replace = TRUE)
|> x
[1] 1 0 2 1 0 2 2 0 2 1
|> tabulate(x)
[1] 3 4
|> table(x)
x
0 1 2
3 3 4
B.
> On Nov 10, 2017, at 4:32 AM, Allaisone 1 wrote:
>
>
>
> Thank you for your effort Bert..,
>
>
> I knew what is the problem now, the values (1,2,3) were only an e
Hi -
This list has a "no homework" policy, but we can certainly help once you show
what effort you have put into this yourself. Read the posting guide, especially
regarding the instructions re. reproducible examples, and follow them exactly.
Cheers,
B.
> On Nov 9, 2017, at 10:05 AM, Hye Joo
ep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
> On Mon, Nov 6, 2017 at 3:28 PM, Boris Steipe wrote:
> Matti -
>
> Since you are asking about looping through a column, not looping acros
Matti -
Since you are asking about looping through a column, not looping across
columns, it is simply the following:
# Note: data.frame() turns strings into factors by default.
myDF <- data.frame(type = c("a", "j", "a", "a", "j"),
weight = c(12.3, 6.8, 10.5, NA, "5.5"))
myDF
Write a for-loop that tests your condition and carries the necessary parameters
forward. break() when your condition is met.
B.
> On Oct 29, 2017, at 10:24 PM, li li wrote:
>
> Dear all,
> The function f() below is a function of m1 and m2, both of which are
> matrices with 3 rows. The func
It's generally a very good idea to examine the structure of data after you have
read it in. str(data2) would have shown you that read.csv() turned your strings
into factors, and that's why the == operator no longer does what you think it
does.
use ...
data_2 <- read.csv("excel_data.csv", strin
This article may be helpful, at least to get you started:
https://www.r-bloggers.com/ordinal-data/
Cheers,
Boris
> On Oct 5, 2017, at 3:35 PM, Bert Gunter wrote:
>
> I would consider this is a question for a statistics forum such as
> stats.stackexchange.com, not R-help, which is about R pr
Just for the record - and posterity: this is the Wrong way to go about defining
a fixed width format and the strategy has a significant probability of
corrupting data in ways that are hard to spot and hard to debug. If you _have_
the specification, then _use_ the specification.
Consider what yo
Since you have an authoritative description of the format, by all means use
that - not a guess based on a visual inspection of where data appears in a
sample row.
B.
> On Oct 5, 2017, at 11:02 AM, jean-philippe
> wrote:
>
> dear Jim,
>
> Thanks for your reply and your proposition.
>
>
Is this a fixed width format?
If so, read.fwf() in base, or read_fwf() in the readr package will solve the
problem. You may need to trim trailing spaces though.
B.
> On Oct 5, 2017, at 10:12 AM, jean-philippe
> wrote:
>
> dear R-users,
>
>
> I am facing a quite regular and basic problem
; to remove 0's rather than NAs , what would it be?
>
> Thanks
>
> On Mon, Sep 25, 2017 at 12:41 PM, Boris Steipe
> wrote:
> myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"),
>b = c("<0.1", 1, 0.3, 5, "
ns
>
> a <- c("<0.1", NA, 0.3, 5, "Nil")
> b <- c("<0.1", 1, 0.3, 5, "Nil")
>
> And I just want to remove the rows from the dataframe where there were NAs in
> the b column, what is the syntax for doing that?
>
> Thanks in adva
> a <- c("<0.1", NA, 0.3, 5, "Nil")
> a
[1] "<0.1" NA "0.3" "5""Nil"
> b <- as.numeric(a)
Warning message:
NAs introduced by coercion
> b
[1] NA NA 0.3 5.0 NA
> b[! is.na(b)]
[1] 0.3 5.0
B.
> On Sep 22, 2017, at 11:48 AM, Shane Carey wrote:
>
> Hi,
>
> How do I extract just n
There are many ways to get the output you want, so your question is ill
defined. But it is easy to see where your code goes wrong. And it should be
easy for you to fix it.
If you subset a vector with the '[' operator, this is like putting a vector of
indices "into" the square brackets. So, to d
gt; Tel / Phone / Mogala : 27+72+2172429
> Email / Epos / Emeile: riaan.vanderw...@nwu.ac.za
> Url: http://www.nwu.ac.za/
>
> >>> Boris Steipe 31 Jul 2017 23:37 >>>
> You need a stemming algorithm. See here:
> https://cran.r-project.org/web/views/NaturalLanguag
You need a stemming algorithm. See here:
https://cran.r-project.org/web/views/NaturalLanguageProcessing.html
Myself, I've had good experience with Rstem.
B.
> On Jul 31, 2017, at 4:47 PM, Riaan Van Der Walt
> wrote:
>
> I am new to R.
> Busy with Text Analysis.
>
> Need a script to fin
Have a look at the functions available in the igraph package.
B.
> On Jul 13, 2017, at 11:08 PM, SEB140004 Student
> wrote:
>
> Greeting.
>
> Dear Mr/Mrs/Miss,
>
> I want to create a network by using R but I only have a table that contain
> OTU ID and the abundance value of two sample
I'd do it this way ... let me know if you need explanations.
minSize <- 15
maxSize <- 100
minSample <- 0.1
maxSample <- 0.8
# setup dataframe with totals, and cases as fractions
myStudies <- data.frame(study = 1:Nstudies,
cases = runif(Nstudies,
t packages exist because others just
> like them contributed something count as being uncivil? Terse, perhaps, since
> it bypassed the obvious suggestion to use a search engine, but not rude.
> --
> Sent from my phone. Please excuse my brevity.
>
> On June 28, 2017 5:08:16
In principle what you need to do is the following:
- break down the time you wish to simulate into intervals.
- for each interval, and each failure mode, determine the probability of an
event.
Determining the probability is the fun part, where you make your domain
knowledge explicit and i
I don't think OP asked an unreasonable question at all.
Civility!
> On Jun 27, 2017, at 2:00 PM, Suzen, Mehmet wrote:
>
> Why don't you implement and uplad the package to CRAN?
>
> On 27 Jun 2017 17:45, "Chris Buddenhagen" wrote:
>
> Does anyone know of some code, and examples that implem
Run it through a loop. I assume the cell contents is NA (Not Available). Test
for it with is.na(). Whenever that returns TRUE, replace the NA value with the
value from the previous row.
Cheers,
B.
> On Jun 24, 2017, at 1:49 PM, Christophe Elek
> wrote:
>
> Hello Total newbie here... I hope
Does:
rainbow(3)[1]
rainbow(3)[2]
rainbow(3)[3]
... solve your issue?
B.
> On Jun 8, 2017, at 8:20 AM, WRAY NICHOLAS wrote:
>
> Hi R folk I have a distance time graph for a locomotive and at various times
> different events occur on board the loco. I want to put a vertical line on
1 - 100 of 353 matches
Mail list logo