Hi Anas,
How about:
cat(row,col,mat_1[row,col],"\n")
Jim
On Thu, Oct 28, 2021 at 7:19 PM Anas Jamshed wrote:
>
> I create a matrix of size 3x3 called mat_1 and then I want to iterate over
> all the values one by one and print the element as well as the position in
> the matrix:
>
> My code is :
Hi Ashim,
I was out for a while. I would first try to restart MySQL, then if
that didn't fix it, try logging in as root and accessing the database.
While I can't debug this at a distance, I'm pretty sure that the
database thinks that you aren't authorized to access it. If the
restart works, your pr
HI Ashim,
That error means that your user number or group is not allowed to
access it. Did you create the new one as a different user, maybe as
root?
Jim
On Thu, Oct 28, 2021 at 4:42 PM Ashim Kapoor wrote:
>
> Dear R - users,
>
> I have 2 databases on a MySQL server. I am able to access the old
ot;mean" merge of the figures. (Perhaps also
> with lines saying: this value comes out 9/10 of times, this 5/10 of
> times...).
> The problem is that the Z values are factors, not numbers.
>
> On Sun, Oct 24, 2021 at 12:08 AM Jim Lemon wrote:
> >
> > Hi Luigi,
> > I
Hi Luigi,
I may be missing the point, but:
matrix((z1+z2+z3)/3,ncol=10)
gives you the mean rating for each item, and depending upon what
distribution you choose, the confidence intervals could be calculated
in much the same way.
Jim
On Sun, Oct 24, 2021 at 7:16 AM Luigi Marongiu wrote:
>
> Hel
Hi Luigi,
Bert has identified the problem. If the ordinates in each row are the
same, you can save quite a bit of space by setting the left and right
margins to zero on all but the left plots in each row. This will jam
the plots together at the sides, but that may not matter to you.
Remember that y
Hi Eliza,
Try this:
BAS1<-
structure(c(3, 4, 2, 3, 3, 4, 3, 3, 3, 3, 2, 3, 3, 4, 3, 2, 2,
3, 2, 3, 3, 3, 4, 5, 3, 4, 3, 4, 4, 3, 4, 4, 3, 3, 3, 4, 3, 3,
3, 4, 3, 3, 4, 5, 4, 4, 4, 3, 4, 3, 3, 3, 3, 4, 4, 5, 4, 3, 4,
4, 2, 3, 3, 3, 2, 4, 4, 3, 3, 4, 3, 3, 3, 3, 4, 4, 3, 3, 2, 3,
3, 3, 3, 2, 5, 2, 4
Hi Avi,
Definitely a learning moment. I may consider writing an ifElse() for
my own use and sharing it if anyone wants it.
Jim
On Sun, Oct 10, 2021 at 6:36 AM Avi Gross via R-help
wrote:
>
> This is supposed to be a forum for help so general and philosophical
> discussions belong elsewhere, or n
Hi Anne,
As mentioned above, you may have to do nothing. Here is an example
that might clarify that:
azdat<-read.table(text="subject 1 2 3
1 10 20 30
2 11 22 33",
header=TRUE,stringsAsFactors=FALSE)
azdat
subject X1 X2 X3
1 1 10 20 30
2 2 11 22 33
As you can see, R simply prepends an
Hi varin,
Not too difficult:
par(mar=c(5,13,4,1))
barplot(height=c(574,557,544,535,534,532,531,527,526,525,524,520,518,
512,507,504,504,489,488,488,487,484,484,474,472,455,444,420),
names.arg=c("Fribourg(f)","Valais(d)",
"Appenzell Rhodes Intérieures","Fribourg(d)","Jura","Schwyz",
"Schaffhouse"
. of 3 variables:
> $ region : char "A","B","C","D",..: 1 2 3 4 5
> $ sales : num 13 16 22 27 34
> $ country: char "a","b","c","d",..: 1 2 3 4 5
> ```
>
> On Sun, Sep 19, 2021 at 11:37 AM Jim Lemon w
Hi Luigi,
It's easy:
df1<-df[,!unlist(lapply(df,is.factor))]
_except_ when there is only one column left, as in your example. In
that case, you will have to coerce the resulting vector back into a
one column data frame.
Jim
On Sun, Sep 19, 2021 at 6:18 PM Luigi Marongiu wrote:
>
> Hello,
> I w
Okay, that was just my reading of the help page. I hope that I haven't
added to the confusion.
Jim
On Fri, Sep 17, 2021 at 10:50 AM H wrote:
>
> On 09/15/2021 09:40 PM, Jim Lemon wrote:
> > Oops, your plot
> >
> > On Thu, Sep 16, 2021 at 11:39 AM Jim Lemon wrot
Hi Petr,
The hard part is the names for the data frame that addtable2plot requires:
set.seed(753)
res <- shapiro.test(rnorm(100))
library(plotrix)
plot(0,0,type="n",axes=FALSE)
addtable2plot(0,0,data.frame(element=names(res)[1:2],
value=round(as.numeric(res[1:2]),3)),xjust=0.5,
title=res$metho
Hi Kai,
I don't know about ggplot, but it may be easier to do it before plotting:
set.seed(753)
testdat<-matrix(sample(1:10,9),nrow=3)
# first plot the raw matrix
barplot(testdat)
# then plot the matrix ordered by column sums
barplot(testdat[,order(colSums(testdat))])
Jim
On Fri, Sep 17, 2021 at
Oops, your plot
On Thu, Sep 16, 2021 at 11:39 AM Jim Lemon wrote:
>
> Hi H,
> Looking at your example and the help page, it looks to me as though
> the plot is consistent with the "A" matrix:
>
> Oz
> Rain Nice
> Rain 0.25 0.75
> Nice 0.60 0.40
>
Hi H,
Looking at your example and the help page, it looks to me as though
the plot is consistent with the "A" matrix:
Oz
Rain Nice
Rain 0.25 0.75
Nice 0.60 0.40
# help page
A - square coefficient matrix, specifying the links (rows=to, cols=from).
In your plot (attached):
Rain (col) goes to
HIi Ani,
I think you are going to a lot of trouble to get a fairly simple result.
# matrix of logicals for positive stat values
possig<-df3 > 0 & df4 < 0.05
# now negative stat values
negsig<-df3 < 0 & df4 < 0.05
# very clunky plots of column counts
barplot(colSums(possig),
names.arg=paste0("S",
HI Ani,
I would create these two matrices:
# matrix of logicals for positive stat values
posvalue<-df3 > 0
# matrix of logicals for significance
sigstat<-df4 < 0.05
Then you can identify the positive/negative and significant values:
which(posvalue & sigstat)
[1] 12
which(!posvalue & sigstat)
[1]
Hi Abou,
One way is to shuffle the original data frame using sample(). and
split up the result into three equal parts.
I was going to provide example code, but Avi's response popped up and
I kind of agree with him.
Jim
On Fri, Sep 3, 2021 at 11:31 AM AbouEl-Makarim Aboueissa
wrote:
>
> Dear All:
Hi Eliza
This seems to work:
plot(BFA3[,1],BFA3[,4],
pch=16, xlab = "", ylab = "",col=(BFA3[,2]==BFA3[,3])+2,axes=FALSE)
but I have no idea what you are trying to do with the
as.numeric(as.Date(...))
business.
Jim
On Fri, Sep 3, 2021 at 8:44 AM Eliza Botto wrote:
>
> Dear useRs,
>
> For the
nts (variable and value).
> Is it possible to add in the output file?
> Thank you very much.
>
> Prof. Dr. Silvano Cesar da Costa
> Universidade Estadual de Londrina
> Centro de Ciências Exatas
> Departamento de Estatística
>
> Fone: (43) 3371-4346
>
>
> Em qua., 25
than men and women and isn't not
> being incorporated in that width.
>
> I think I'll have to settle for a smaller title
>
> Sent from Yahoo Mail on Android
>
> On Tue, 24 Aug 2021 at 6:54 PM, Jim Lemon
> wrote:
> Ah, an _upper_ limit. Why not let tiff() work
Hi Silvano,
I was completely stumped by your problem until I looked through Petr's
response and guessed that you wanted the largest sum of 'Var.1"
constrained by the specified numbers in your three schemes. I think
this is what you want, but I haven't checked it exhaustively.
set.seed(123)
Var.1 <
al\Temp\RtmpoPSf4N\downloaded_packages’
>
> Session info:
> > sessionInfo()
> R version 4.1.1 (2021-08-10)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 18363)
>
> Matrix products: default
>
> locale:
> [1] LC_COLLATE=Chinese (Simplified)_
it of 440 pixels for the width and an upper limit of
> 300 for the dpi.
>
> On Tuesday, 24 August, 2021, 06:36:16 pm GMT-4, Jim Lemon
> wrote:
>
>
> Hi bharat,
> I think there is a conflict between your image size and resolution.
> You need a lot larger height and width i
This is beginning to sound like a stats taliban fatwa. I don't care if
you're using an abacus, you want to get the correct result. My guess
is that the different instantiations of the Hochberg adjustment are
using different algorithms to calculate the result. The Hochberg
adjustment is known to be
Hi bharat,
I think there is a conflict between your image size and resolution.
You need a lot larger height and width in pixels to get 300 dpi
resolution for the whole plot.
tiff("test.tiff", units = "px", width = 2200, height = 1250, res = 300)
would probably do it for you. How come you can't c
Hi Kai,
How about setting:
germlinepatients$DisclosureStatus <- NA
then having your three conditional statements as indices:
germlinepatients$DisclosureStatus[germlinepatients$gl_resultsdisclosed
== 1] <-"DISCLOSED"
germlinepatients$DisclosureStatus[germlinepatients$
gl_resultsdisclosed == 0] <-
Hi bharat,
notrend_test (funtimes) wants a vector (univariate time series) as the
first argument. My crystal ball suggests that column_Data is too
short, but try this:
notrend_test(column_Data,test="WAVK")
Be aware that this is a guess.
Jim
On Thu, Aug 19, 2021 at 1:58 PM bharat rawlley via R-h
Hi Paul,
I just worked out your first request:
datasetregs<-<-structure(list(Date = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L
Hi Elham,
Your image didn't get through, maybe PNG will work. Label crowding is
a common problem, whether horizontal or vertical. One solution is to
set a maximum length on label text (see truncString in the prettyR
package). Others are to stagger labels (staxlab in plotrix) or shift
them apart whe
>
> Md
>
> On Mon, Aug 9, 2021 at 1:17 PM Jim Lemon wrote:
>>
>> And if you really don't like programming:
>>
>> whipple_index<-function(x,td=c(0,5)) {
>> wi<-rep(NA,11)
>> names(wi)<-c(paste0("wi",0:9),"O/all&q
And if you really don't like programming:
whipple_index<-function(x,td=c(0,5)) {
wi<-rep(NA,11)
names(wi)<-c(paste0("wi",0:9),"O/all")
for(i in 0:9) {
ttd<-which((x %% 10) %in% i)
wi[i+1]<-length(ttd) * 100/length(x)
}
ttd<-which((x %% 10) %in% td)
wi[11]<-length(ttd) * 100/(length(x)/le
Value is redrd rdrd
> 3 3 empty mpty mpty mpty
> ```
>
> On Mon, Aug 9, 2021 at 12:40 PM Luigi Marongiu
> wrote:
> >
> > Thank you, that is much appreciated. But on the real data, the
> > substitution works only on
Hi Luigi,
Ah, now I see:
df$VAL<-gsub("Value is","",df$VAL,ignore.case=TRUE)
df
VAR VAL
1 1 blue
2 2 red
3 3 empty
Jim
On Mon, Aug 9, 2021 at 6:43 PM Luigi Marongiu wrote:
>
> Hello,
> I have a dataframe where I would like to change the string of certain
> rows, essentially I am lo
Hi Luigi,
It looks to me as though you will have to copy the data frame or store
the output in a new data frame.
Jim
On Mon, Aug 9, 2021 at 6:26 PM Luigi Marongiu wrote:
>
> Hello,
> I would like to recursively select the columns of a dataframe by
> strong the names of the dataframe in a vector
Hi Rolf,
What about:
mkdir /usr/lib/R/doc
Jim
On Sun, Aug 8, 2021 at 12:45 PM Rolf Turner wrote:
>
>
> Should/shouldn't there be one?
>
> My R seems to be installed in /usr/lib/R. If do an "ls" of this
> directory, I get:
>
> > bin/ COPYING@etc/ lib/ library/ modules/
> > site-libr
Hi Admire,
I think rep_n_stack in the prettyR package may do what you want:
# download and install the prettyR package
install.packages("prettyR")
# load the prettyR package
library(prettyR)
# read in your data
ATCdf<-read.csv("BOP_All_Countries.csv",stringsAsFactors=TRUE)
# convert the values you
Hi Admire,
Neither the R script nor CSV file was attached to your message. Both
should be plain text files and are unlikely to be rejected by the help
list mail server. Perhaps check your email client.
Jim
On Tue, Aug 3, 2021 at 5:09 PM Admire Tarisirayi Chirume
wrote:
>
> Hello, i hope you are
top D5800
> Austin, TX 78712-1289
>
>
>
>
>
> On Fri, Jul 30, 2021 at 12:39 AM Jim Lemon wrote:
>
>> Hi Reza,
>> I just had a look at that and found the problem. I had not passed the
>> "showcount" argument in the recursive calls. The attached co
Hi Stefano,
Try using rollsum from the zoo package:
library(zoo)
rollsum_index<-function(x,window,val) return(which(rollsum(x,window) >= val))
rollsum_index(mydf$hn,2,80)
[1] 6 13 18 19
Jim
On Fri, Jul 30, 2021 at 5:24 PM Stefano Sofia
wrote:
>
> Dear R users,
> I have a data frame with daily
Speedway, Stop D5800
> Austin, TX 78712-1289
>
>
>
>
>
> On Thu, Jul 29, 2021 at 4:42 PM Jim Lemon wrote:
>
>> Hi Reza,
>> Thanks for letting me know. I will get to this ASAP.
>>
>> Jim
>>
>> On Thu, Jul 29, 2021 at 11:21 PM Reza Norouzian
>&
Hi Shawn,
I don't have any trouble with this:
times<-c("7/20/21 13:30","7/20/21 13:40")
strptime(times,"%m/%d/%y %H:%M",tz="GMT")
[1] "2021-07-20 13:30:00 GMT" "2021-07-20 13:40:00 GMT"
I suspect that Excel is causing the problem. Try changing the format
of the date column to "Text" and work on t
nthesis are needed to
>> keep the dimensions, the matrix form.)
>> And, I'm not sure but isn't
>>
>> head(gev.fit)[1:4]
>>
>> equivalent to
>>
>> head(gev.fit, n = 4)
>>
>> ?
>>
>> Like Jim says, we need more informat
Hi Siti,
I think we need a bit more information to respond helpfully. I have no
idea what "Ozone_weekly2" is and Google is also ignorant. "gev.fit" is
also unknown. The name suggests that it is the output of some
regression or similar. What function produced it, and from what
library? "ti" is known
Hi Adrianna,
I can see why you may be confused about the input file to create the
dataframe for bibliometrix. Looking at the 'convert2db' function, it
seems to shuffle the various formats to a common order used by other
functions. The help page describes that order. I would look at the
sample file
Hi Jeremie,
Try:
as.Date("20-12-2020","%y-%m-%d")
[1] "2020-12-20"
Jim
On Thu, Jul 1, 2021 at 6:16 PM Jeremie Juste wrote:
>
> Hello,
>
> I have been surprised when converting a character string to a date with the
> following
> format,
>
> in R 4.1.0 (linux debian 10)
>
> as.Date("20-12-2020",
Hi Esthi,
Have you tried something like:
df2<-merge(df,df1,by.x="Sample",by.y="Plot",all.y=TRUE)
This will get you a right join in "df2", not overwriting "df".
Jim
On Wed, Jun 30, 2021 at 1:13 AM Esthi Erickson wrote:
>
> Hi and thank you in advance,
>
> If I have a dataframe, df:
>
> Sample
>
Hi Andre,
I've taken a different approach to that employed by Eric:
A<-data.frame(c("01/01/2020","01/01/2020","01/01/2020","01/01/2020","01/01/2020",
"01/01/2020","01/01/2020","01/01/2020","01/01/2020","01/01/2020","01/01/2020",
"01/01/2020","01/02/2020","01/02/2020","01/02/2020","01/02/2020","0
Hi Ding,
There are a number of "value to color" functions in various packages.
One is "color.scale" in the plotrix package:
library(plotrix)
s1 <-c(0.085,0.086,0.139,0.129,0.235,0.177,0.000,0.126,0.271,0.000,0.083,0.163)
s2 <-c(0.000,0.093,0.000,0.080,0.072,0.388,0.138,0.107,0.000,0.000,0.474,0.00
Hi Bruno,
The interaction.plot function plots the _levels_ of the x.factor
argument, not the values of the variable that is coerced to a factor.
This means that the temperature locations on the x axis are c(1,2),
not c(12,17). The code below works for me:
readscaphfileNEW<-read.table(text="EXPERIM
Hi Jeremie,
Or assuming that the matrix will always contain strings:
tabify<-function(x,col_names=NULL) {
# convert NAs to "NA"
x[is.na(x)]<-"NA"
# if this matrix doesn't have any column names
if(is.null(col_names)) col_names<-LETTERS[1:ncol(x)]
# get the format argument for sprintf
tab_widt
Hi Abdullah,
A good job of proof reading, something too often neglected in documentation.
Jim
On Fri, Jun 11, 2021 at 4:51 PM Abdullah Khasawneh
wrote:
>
> Dear all,
>
> I have recently finished reading "Introduction to R" and enjoyed it and
> benefited from it immensely. Thank you very much fo
Hi Bhaskar,
Perhaps you are looking for this:
approx(c(3,6,7),n=21)
$x
[1] 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7
2.8
[20] 2.9 3.0
$y
[1] 3.0 3.3 3.6 3.9 4.2 4.5 4.8 5.1 5.4 5.7 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7
6.8
[20] 6.9 7.0
This assumes that you are taking ea
Hi Kai,
Maybe this will help:
proband_crc2<-data.frame(MMR=rep(c(NA,"+"),3))
proband_crc2
proband_crc2$MMR[is.na(proband_crc2$MMR)]<-"-"
proband_crc2
Jim
On Wed, Jun 2, 2021 at 9:59 AM Kai Yang via R-help wrote:
>
> Hi List,
> I have a column MMR in a data frame proband_crc2. The column content
Hi Kai,
You seem to be asking the same question again and again. This does not
give us the warm feeling that you know what you want.
testdf<-data.frame(a=c("Negative","Positive","Neutral","Random","VUS"),
b=c("No","Yes","No","Maybe","Yes"),
c=c("Off","On","Off","Off","On"),
d=c("Bad","Good","Ba
Hi Kai,
You may find %in% easier than grep when multiple matches are needed:
match_strings<-c("MLH1","MSH2")
CRC<-data.frame(gene.all=c("MLH1","MSL1","MSH2","MCC3"))
CRC$MMR.gene<-ifelse(CRC$gene.all %in% match_strings,"Yes","No")
Composing your match strings before applying %in% may be more flex
Hi Bhaskar,
If you are using read.table or similar, see the "fill=" argument.
Jim
On Thu, May 20, 2021 at 9:54 AM Bhaskar Mitra wrote:
>
> Hello Everyone,
>
> I am trying to extract data from a url. The codes work well when the
> data structure is as follows:
>
> X Y
> 1 2
> 1 5
> 1 6
> 1 7
> 3
Hi Steven,
I just happened to scan Petr's message to you and wondered if you were
looking for something related to the "describe" function in the
prettyR package (and a few others). For instance, if you do this:
library(prettyR)
describe(mtcars)
you get this:
Description of mtcars
Numeric
Hi varin,
Were you expecting image files? I don't see any plot device e.g. pdf()
in your code.
Jim
On Wed, May 12, 2021 at 6:34 PM varin sacha via R-help
wrote:
>
> Dear Experts,
>
> My R code was perfectly working since I decide to add a 5th correlation
> coefficient : hoeffdings' D.
> fter a
> John
>
> John Fox, Professor Emeritus
> McMaster University
> Hamilton, Ontario, Canada
> web: https://socialsciences.mcmaster.ca/jfox/
>
> On 2021-05-06 10:31 p.m., David Winsemius wrote:
> >
> > On 5/6/21 6:29 PM, Jim Lemon wrote:
> >> Hi James,
&
Hi James,
If the result contains the major (a) and minor (b) axes of the
ellipse, it's easy:
area<-pi*a*b
try using str() on the result you get.
Jim
On Fri, May 7, 2021 at 3:51 AM james meyer wrote:
>
> In doing meta-analysis of diagnostic accuracy I produce ellipses of confidence
> and predic
Hi Myungjin,
The funnel plot is no more than the precision of the estimates of
related studies plotted against the estimates. That is, if your
measure of precision is the sample size (SS) and the estimate is named
E,
plot(E,SS)
Look at the metafor package for good funnel plot functions. Egger's
t
Hi email,
If you want what you described, try this:
xx<-read.table(text="COMPANY_NUMBER NUMBER_OF_YEARS
0070837 3
0070837 3
0070837 3
1000403 4
1000403 4
1000403 4
1000403 4
10029943 3
10029943 3
10029943 3
10037980 4
10037980 4
10037980 4
10037980 4
10057418 3
10057418 3
10057418
Hi Matthew,
The conventional way to document a function that doesn't return a value is:
\value{nil}
in the .Rd file. In the arguments section, if your data frames are
named as "d1" and "d2",
\item{d1,d2}{Two data frames.}
Add any relevant information such as whether they must be conformable.
J
Hi SunYong,
The docs are not exactly clear on this, but you might try adding
axes=FALSE instead of xaxt="n" and then calling both axes separately.
Jim
On Mon, Apr 26, 2021 at 5:28 PM Sun Yong Kim
wrote:
>
> vars package
>
> From: John Kane
> Sent: Sunday, April
Hi Marna,
This may be what you want:
get_latest<-function(x,format="%m/%d/%Y") {
x<-unlist(x)
x[nchar(x)==0]<-NA
if(all(is.na(x))) return(NA)
else return(format(max(as.Date(x,format),na.rm=TRUE),format))
}
daT$output1<-apply(daT[,2:4],1,get_latest)
The empty value in daT gave a bit of trouble
Hi John,
If the program is still running, I can only guess that the function is
not exiting properly. If this happened to me, I would run "top" in a
terminal window and see if that process number was actually doing
anything or had gone zombie.
Jim
On Tue, Apr 20, 2021 at 11:28 AM John wrote:
>
>
Hi Shah,
I think what you are struggling toward is this:
prior_lhs <- list(r_mu=c( 0.00299, 0.0032),
r_sd=c( 0.001, 0.002),
lmp=c( 0.40, 0.43),
gr_mu=c( 0.14, 0.16),
gr_s=c( 0.01, 0.020),
alpha1=c( 0.0001, 0.
Hi Gene,
This is probably not best practice, but I install packages as root,
which allows me to write into the default library. The restriction on
non-root users being blocked from making changes to appications is
pretty standard.
Jim
On Thu, Apr 8, 2021 at 8:18 AM Gene Leynes wrote:
>
> Hello R
Hi Ralph,
I suppose you could write a wrapper for q():
byebye<-function(drop=".Random.seed",save = "default", status = 0,
runLast = TRUE) {
if(drop %in% ls(all.names=TRUE)) rm(drop,pos=1)
q(save=save,status=status,runLast=runLast)
)
warning: untested
Jim
On Thu, Apr 1, 2021 at 7:05 PM Ralf Go
Hi Mahmood,
As I don't know what "mydata" is, I'll have to fake it. Do you want
something like this?
yourdata<-data.frame(x1=c(1250,600,rep(200,9)),
x2=c(7000,2300,800,rep(100,8)),
x3=c(8900,950,300,rep(0,8)),
x4=c(1400,1000,rep(600,4),rep(200,5)))
library(plotrix)
violin_plot(yourdata)
Jim
O
Hi Collins,
pie3D draws a pseudo-3D pie and then places 2D labels around it. If
you put the labels on top of the pie, it is not going to look right.
The labels will be displayed with an orthogonal viewing angle, while
the pie will be tilted. pie3D is one of those functions that I wrote
for those wh
Hi Ferri,
Just for fun, I plotted six countries with the current COVID deaths,
per million against both population and median income. Even I was
surprised.
library(plotrix)
country<-c("USA","Brazil","India","UK","Czechia","Mexico")
COVIDdeath<-c(1694,1471,117,1858,2445,1553)
Countrypop<-c(332,214,
Hi Rachida,
My guess is that you create a vector of filenames:
filenames<-list.files(path="FicConfig",pattern="*.txt")
then use the filenames in the loop:
for(filename in filenames) {
nextfile<- read.table(filename, header = TRUE, sep = "\t" , dec =
",", skip = 0)
# do whatever you want with
Hi Marcelo,
Just google for "word cloud r". Too much information.
Jim
On Tue, Mar 30, 2021 at 11:18 AM Marcelo Laia wrote:
>
> Hi,
>
> I would like to do a word cloud in a specif site related to a specific
> word.
>
> For example, I could be interested in discovery what are the words
> linked to
Hi Abby,
Have a look at the first example in the radial.pie function (plotrix).
Jim
On Tue, Mar 30, 2021 at 7:59 AM Abby Spurdle wrote:
>
> I couldn't find a predefined function for this purpose.
> However, it wouldn't be too difficult to write a pair of functions.
>
> The big question is how fl
Hi Ferri,
There are a number of variations on the pie chart. The fan.plot,
radial.pie and starPie functions in the plotrix package are but a few.
There are two really important considerations in using plots like
this:
1) Does the plot illustrate what you want? For example, if you want to
show that
Hi Mahmood,
What you have specified can be done with:
col=c(rep("black",10),rep("red",10))
depending upon what print function you are using. I suspect that this
may be based on a value in your data. For example, if you want black
for values of some variable up to 10 and red for those over:
col=
Hi,
As you still seem to be asking for an answer, the following code may help.
# begin with a minimal data frame
patdb<-data.frame(patno=paste0("p",sample(100:300,200,TRUE)),
date=c(paste(2020,11,sort(sample(1:31,66,TRUE)),sep="-"),
paste(2020,12,sort(sample(1:31,67,TRUE)),sep="-"),
paste(2021,
;-a[a[,1] != 1,] this will work for first column only.
>>
>> If I'm trying same by this
>> c<-a[a[,1] !=2,]
>> c<-a[a[,2] !=2,]
>> Two times
>> So i was tried for loop but I'm stucked.
>>
>> On Fri, Mar 26, 2021, 2:37 AM Jim Lemon
Hi ma015k3113,
I suspect that you are asking the wrong question.
# create an example data frame with an extra field
PLC<-read.table(text="YEAR_END_Date EPS junk
2010-09-10.10 A
2009-08-10.20 B",
header=TRUE,
stringsAsFactors=FALSE)
# first, I think that you may already have t
Hi Javad,
You may be trying to reinvent the wheel. Have you looked at Image Magick?
Jim
On Tue, Mar 23, 2021 at 11:42 PM javad bayat wrote:
>
> Dear R users;
> Is there any way to increase the resolution of a raster so as to be seen
> more clear?
> I have a raster which is not very clear. I want
No, I am confounded, It does return the value of the expressions
within the respective braces, just like ifelse. Learn something every
day.
Jim
On Mon, Mar 22, 2021 at 9:35 PM Jim Lemon wrote:
>
> If he's setting PRE to the return value of "if", that is the logical
> va
t.
PRE<-ifelse(missing(GAY),(GA/GA)*100,(GA/GAY)*100)
would return either value depending upon whether GAY was missing.
That's what I get from the help pages.
Jim
On Mon, Mar 22, 2021 at 8:34 PM Duncan Murdoch wrote:
>
> On 22/03/2021 1:59 a.m., Jim Lemon wrote:
> > Hi Goyan
Hi Goyani,
You are setting "PRE" to the return value of "if" which is one of TRUE
(1), FALSE(0) or NULL. Because GAY is always missing in your example,
"PRE" is always set to 1. Then you always want to pass 1 in the sample
list, and that will not assign anything to PRE. By correcting the "if"
claus
Hi Goyani,
In its present form, the function stalls because you haven't defined
pmat before trying to pass it to the function. gmat and wmat suffered
the same fate. Even if I define these matrices as I think you have,
"solve" fails because at least one is singular. First, put the
function in order
Hi Greg,
This example may give you a start:
myDat<-read.table(text=
"2021-03-11 10:00:00
2021-03-11 14:17:00
2021-03-12 05:16:46
2021-03-12 09:17:02
2021-03-12 13:31:43
2021-03-12 22:00:32
2021-03-13 09:21:43",
sep=",",
stringsAsFactors=FALSE)
myDat$datetime<-strptime(myDat$X,for
Hi Greg,
As the POSIX conversion part is already answered, I'll add:
as.Date("16/03/2021",format="%d/%m/%Y")
converts to Date object and
axis.Date()
will display dates on the date axis in base graphics.
Jim
On Tue, 16 Mar 2021, 08:33 Gregory Coats via R-help I store in a text file the dates
Hi Areti,
Maybe this will help:
scrounging<-data.frame(
behav=sample(c("inactive","active","foraging","snoozing"),50,TRUE),
substr=sample(c("tree","ground","vine","air"),50,TRUE))
scrounge.tab<-table(scrounging)
barplot(scrounge.tab)
legend(3.8,14,c("inactive","active","foraging","snoozing"),
f
I must agree with the criticism of BMI as a diagnostic index. It is
easy to tell if a person is - ahem - wide and not very high with a
single glance. These elementary parameters can easily be deduced from
an image of said person. However, it does not convey that essential
ratio of muscle to - ahem
Hi Paul,
The paper doesn't seem to mention R and the journal doesn't inspire
confidence, but the formulas provided give you a start:
https://www.researchgate.net/publication/280133090_Calculation_of_Body_Mass_Index_using_Image_Processing_Techniques
Jim
On Mon, Mar 1, 2021 at 3:39 AM Paul Bernal
Hi A,
I'm unable to work out what you are using as input. Maybe:
id<-data.frame(Type=c(1,2,1,1,2),set=c(1,3,5,7,8))
but that doesn't work with your
tapply(id,Type,set)
command. Perhaps a bit more detail?
Jim
On Wed, Feb 17, 2021 at 7:48 PM A. Mani wrote:
>
> I want a data frame (derived f
Hi Jeremie,
Try this:
test <- function() {
a<-readline("selection: ")
return(a)
}
If it starts working, it could be a difference in the way Windows R
handles text input. Both work okay for me on fedora linux.
Jim
On Tue, Feb 9, 2021 at 12:29 AM Jeremie Juste wrote:
>
> Hello,
>
> I have noti
Hi varin,
How about this:
Mbv<-data.frame(MSE=rep(NA,1000),
biais=rep(NA,1000),variance=rep(NA,1000))
for(i in 1 :1000) {
n<-dim(Dataset)[1]
p<-0.667
sam<-sample(1 :n,floor(p*n),replace=FALSE)
Training <-Dataset [sam,]
Testing <- Dataset [-sam,]
fit2<-lm(PIB.hab~ISQ.2018)
ypred<-predict(fit
Hi Jean,
kripp.alpha expects a classifier by object (in your case, score)
matrix as the first argument. If I read your code correctly you are
getting the scores zigzagging across six columns when you want a 6 x
180 matrix. My guess is that you want:
Trainers<-matrix(c(Trainer_1,Trainer_2, Trainer_
Hi Jibrin,
solar_wind_sps<-data.frame(sws=306,date="2021-016")
solar_wind_spd
solar_wind_spd$date<-as.Date(solar_wind_spd$date,"%Y-%j")
solar_wind_spd
This changes the "date" field to an actual date object. If you just
want to change a character string date to another format:
solar_wind_spd$date<
Hi Gordon,
Looks to me as though you may have to extract the text from the Word
files. Export As Text.
Jim
On Thu, Jan 7, 2021 at 10:40 AM Gordon Ballingrud
wrote:
>
> Hello all,
>
> I have asked this question on many forums without response. And although
> I've made progress myself, I am stuck
Hi Greg,
I think what you want is:
mtext (side=4, "median", col="firebrick4", at=median(walk_seconds))
"adj" defaults to 0.5 and is usually okay. It looks to me as though
mtext has taken your _character_ strings as non-numeric and then tried
to work something out with par("las"). Experts more fa
101 - 200 of 3432 matches
Mail list logo