Hi Zuhri,
Try:
mydf<-mydf[,c(2,1)]
You might be surprised.
Jim
On Tue, Sep 10, 2019 at 12:20 PM smart hendsome via R-help
wrote:
>
> Hi R-user,
> I have a problem regarding R. How can I move my 2nd column into 1st column.
> For example I have data as below:
> mydf <- data.frame(matrix(1:6,
On 9/9/19 7:19 PM, smart hendsome via R-help wrote:
Hi R-user,
I have a problem regarding R. How can I move my 2nd column into 1st column.
For example I have data as below:
mydf <- data.frame(matrix(1:6, ncol = 2))
mydf
X1 X2 1 4 2 5 3 6
I want move my 2nd column become li
Hi R-user,
I have a problem regarding R. How can I move my 2nd column into 1st column.
For example I have data as below:
mydf <- data.frame(matrix(1:6, ncol = 2))
mydf
X1 X2 1 4 2 5 3 6
I want move my 2nd column become like this:
X1 1 2 3 4 5 6
Hope anyone can
Dear All,
Many thanks for all your contributions, suggestions and advice.
I find them all useful.
Best wishes
Ogbos
On Mon, Sep 9, 2019 at 9:35 PM Rui Barradas wrote:
>
> Hello,
>
> I cannot reproduce the error but I coerce to class "Date" first.
>
>
> MOSCFD50[[1]] <- as.Date(MOSCFD50[[1]])
> na
Hi,
I typically start R with "--no-restore --no-save" (to avoid .RData
files being written) and would like to have the same behavior under 'R
CMD BATCH'. I use R_BATCH_OPTIONS="--no-restore --no-save" in my
~/.Renviron but running an R script with 'R CMD BATCH' still produces
a .RData file. What's
Hello,
I cannot reproduce the error but I coerce to class "Date" first.
MOSCFD50[[1]] <- as.Date(MOSCFD50[[1]])
names(MOSCFD50) <- c("date", "value")
# Your subset
Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31")
# Another way, if there are NA's, use which(i)
i <- MOSCFD50$
To get a quick answer to your question you should provide a smallexample
that one can simply copy and paste into an R session. It also helps to
show some details about how something does not work, more than " But it
didn't work." E.g.,
d <- read.table(header=FALSE, text="1997-11-23 -2.917096290
Dear Bert and Jeff,
The result is an output of another code and it will be too long or
unnecessary to show all I'm I did to arrive at the given data frame.
Since my single line code works for Jeff, I had to take a second look
and try to get it working for me. I then read the data frame using
d<-re
Works for me. Apparently you are not showing us everything you are doing. As
Bert recommended, you need to use the dput function rather than dumping numbers
into the email if we are to know how your data are stored in memory which will
affect what results you get. I highly recommend using the re
Dear Bert and Jeff,
Thank you for looking at this.
I am surprised my message was not in plain text. It has been
configured to send message to the list in plain text earlier before.
The data again please.
1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-
Hello,
I'm glad it helped.
One more thing. I forgot to set the column names, if you want to get
them from the data, try something like this:
nms <- lapply(s, function(.s) .s[grepl("[[:alpha:]]+", .s)])
nms <- sapply(nms, paste, collapse = ".")
names(daT3) <- nms
daT3
Hope this helps,
Rui Ba
You can use the vector of integer cluster numbers with silhouette()
from the cluster package.
https://www.rdocumentation.org/packages/cluster/versions/2.1.0/topics/silhouette
But note that silhouette as an assessment metric makes roughly the
same assumptions that k-means does about the data stru
Wrong mailing list. Read the Posting Guide and the package description.
On September 7, 2019 11:34:29 AM PDT, Jon Hak wrote:
>I've used SDMTools and Fragstats frequently and I'm trying out the
>recently published landscapemetrics. I'e worked through the agusta
>demo
>that came with the package
Or the column is not named "date", or it is a factor... and the question is not
posted in plain text
On September 9, 2019 9:55:48 AM PDT, Bert Gunter wrote:
>I would guess that you first need to convert your textual dates to a
>date-time object via as.date, but as you failed to provide a
>re
I would guess that you first need to convert your textual dates to a
date-time object via as.date, but as you failed to provide a reproducible
example (e.g. via dput) I may be wrong. Maybe others may have greater
insight.
Bert Gunter
"The trouble with having an open mind is that people keep comin
Hi together,
I’m new using R and have a question concerning the Silhouette coefficient. I’ve
clustered very easy objects with Affinity Propagation.
My data just has one numeric attribute.
apres <- apcluster(negDistMat(r=2), data, details=TRUE)
show(apres)
This worked very well. To compare wit
I've used SDMTools and Fragstats frequently and I'm trying out the
recently published landscapemetrics. I'e worked through the agusta demo
that came with the package so I think I've got a handle on how to
process the models I would like to use, but I 'm a bit stumped. the
show_patches() is wh
Dear Contributors,
I have a data frame of the form:
1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2
Beginners should definitely read the Posting Guide mentioned in the footer of
this and every message from this mailing list. One key point is that this
mailing list is for plain text format only, and your message gets damaged to
varying degrees when you fail to set the plain text format option i
Wrong mailing list (use R-package-devel. Don't post HTML... your email is full
of unreadable characters.
On September 8, 2019 11:27:27 PM PDT, "VILAR ÁLVAREZ ANDREA"
wrote:
>
>Hi,
>
>I am writting because I am doing a package in R and I have some
>problems installing dependences which appear at
A new package "sclr" for fitting the "scaled logit" model from Dunning
(2006) is available.
CRAN: https://cran.r-project.org/package=sclr
Github: https://github.com/khvorov45/sclr
I appreciate any feedback.
Best regards,
Arseniy Khvorov
___
R-pack
Dear Sir,
After installing prospectr,
> data(NIRsoil)> mode(NIRsoil)[1] "list">
I am a beginner and the structure of “NIRsoil” is complicated.
Judging from the explanation of NIRsoil (see below), there are six elements:
NT, Ciso, CEC, train, validation, spc.
Please tell me how to know the str
Hi,
I am writting because I am doing a package in R and I have some problems
installing dependences which appear at DESCRIPTION file.
First of all, I am not sure about the difference between �Depends� and
�Imports�, but I only use �Depends�.
My problem is that my package is going to be used at
First post, please excuse any ignorance.
install.packages() seems to only respect install.packages(lib=) for
the specified package (in the below case {purrr}) and will ignore any
dependencies ({magrittr}, {rlang}) if they are found in any of the
directories in .libPaths() (e.g. R_LIBS). The reaso
Hello,
You could try a character class instead of one character (the tab char).
There are two character classes that you can try, [:blank:] and
[:space:], see ?regex.
strsplit(as.character(daT1), "[[:blank:]]+")
Then form the final result. I have changed rbind to cbind, it seemed
more approp
Hi R User,
I was trying to split a column by tabs, I tried to split with several ways,
but I could not split it. Is there any possibilities?
The data example and the code I used
daT1<-c("Column number 12345678
9 10 10 10 10 10 10 10",
"comes f
26 matches
Mail list logo