gt;> is not very interactive by does create a useful 3D plot. The data that I
>> used was
>> generally not very large.
>>
>> In the sample commands "R_terminal_input.txt", the working directory is
>> given as
>> "C:/rgl_test". Line 14 in t
way to do that with arbitrary scattered points. That is why
the surface3d function interface is separate from the points3d function
interface ... it uses a matrix to communicate adjacency for four points at a
time.
On March 23, 2020 7:54:04 PM PDT, EK Esawi via R-help
wrote:
>
>Thank
ooked at was in principle components so x, y, and z were in the same
units.
I can post a sample of the terminal input that I used if that would help.
LMH
Ek Esawi wrote:
> Hi All--
>
> I have been looking into 2D and 3D graphing packages. Based on what i
> read, it seems that ggplot2 is
Hi All--
I have been looking into 2D and 3D graphing packages. Based on what i
read, it seems that ggplot2 is the best and I like it too, but ggplot2
doesn't have 3D plotting capabilities. I read that other packages
(plot_ly, rgl, rayshader) can be used with ggplot2 to create 3D
charts, but not su
Hi
If i understand your question correctly, it seems split or split date
will do what you want.
BOL--EK
On Fri, Apr 26, 2019 at 10:51 AM Lorenzo Isella
wrote:
>
> Dear All,
> I must be drowning in a glass of water.
> Consider the following data set
>
> tt2<-structure(list(year = c(2000, 2001, 2
choices<- sapply(MyDF$B, strsplit, split = " +")
> > nm <- names(MyList)
> > MyDF$C <- nm[sapply(choices, function(x)match(TRUE,
> > sapply(MyList,function(tbl)any(x %in% tbl]
> > MyDF$C
> [1] "Y" "z" "X" NA NA
>
&
Thank you. Sorry i forgot to turn off the html
Below is a sample of my data. My original data frame has over 10,000 rows.
I want to check each element on my data frame column B
(MyDF$B) to see if it contains any element(s) of MYList. if os, change
the value of MyDF$C to the name of the vector of t
Hi All--
Sorry i sent the one inadvertently
Her is a sample of my data. A data frame (MyDF) and a list (MyList). My
own data frame has over 10,000 rows. I want to find out which elements of
MyDF$B contain any element(s) of MYList; then change MyDF$C to the name of
the vector of the list that has
Hi All
Her is a sample of my data. A data frame (MyDF) and a list (MyList). My
own data frame has over 10,000 rows. I want to find out which elements of
MyDF$B contain any element(s) of MYList; then change MyDF$C to the name of
the vector of the list that has match.
I solved this via loops and i
f to
> make the grouping column?
>
> On March 15, 2019 10:40:01 PM PDT, Ek Esawi wrote:
> >Hi All—
> >
> >I have a data frame with over 13000 rows and 4 columns. A mini data
> >frame is given at the bottom. I want to split the data frame into
> >lists each co
Hi All—
I have a data frame with over 13000 rows and 4 columns. A mini data
frame is given at the bottom. I want to split the data frame into
lists each corresponds to single year which ranges from 1990 to 2018).
I wanted to use the split function, but it requires a vector of the
same length as My
Thank you Peter. That's a dumb question on my part! At least i should
have known that i need an assignment statement.
Thanks again--EK
On Tue, Mar 5, 2019 at 11:36 AM peter dalgaard wrote:
>
> You need a print() around the gsub(...) when inside a loop.
>
> -pd
>
> > On
Hi All,
I am using xlsx package to extract and clean data from an Excel
Workbook. I ran into a strange behavior that I don’t understand. The
gsub doesn’t work inside the loop but does outside the loop as shown
on my code.. Tried to Google for help but nothing came up.
My code loads and reads data
This is a similar versions of other answers.
df[apply(apply(df,2,is.finite),1,sum)==4,]
BOL---EK
On Sat, Feb 16, 2019 at 10:07 AM AbouEl-Makarim Aboueissa
wrote:
>
> Dear All: good morning
>
>
> I have a log-transformed data frame with some *-Inf* data values.
>
> *my question: *how to remove a
Hi All--
I have a list which contain variables 0s at the end of each vector on
the isit. I want to create a new list with only numbers > 0.
It seems simple, but i tried several option, none of which worked.
CCC <- list(A=c(1,2,3,0,0,0,0), B=c(2,3,4,5,0,0,0,0,0,0))
for (i in 1:length(CCC)) {
f
FillList and then converting to a data frame. If
> you can send some data (if it's not too big) I can test it and make
> sure that it works, as it did every time for me.
>
> Jim
>
> On Thu, Dec 20, 2018 at 2:22 PM Ek Esawi wrote:
> >
> > Thank you Jim. I did use u
the levels or a nested list to convert it to a single level list.
>
> Jim
>
> On Thu, Dec 20, 2018 at 1:33 PM Ek Esawi wrote:
> >
> > Thank you Bert. I don't see how unlist will help. I want to combine
> > them but keep the "rectangular structure",e.g
On Wed, Dec 19, 2018 at 9:10 PM Bert Gunter wrote:
>
> Does ?unlist not help? Why not?
>
> Bert
>
>
> On Wed, Dec 19, 2018, 5:13 PM Ek Esawi >
>> Hi All—
>>
>> I am using the R tabulizer package to extract tables from pdf files.
>> The output is a
Hi All—
I am using the R tabulizer package to extract tables from pdf files.
The output is a set of lists of matrices. The package extracts tables
and a lot of extra stuff which is nearly impossible to clean with
RegEx. So, I want to clean it manually.
To do so I need to (1) combine all lists in
;,"b","c"))
> BB <- list(c=c(1,2,3,4,5),d=c("a","b","c","d","e"))
> mylist <- c(AA,BB)
> mydf
> Jim
>
> On Mon, Dec 17, 2018 at 12:45 AM Ek Esawi wrote:
> >
> > Thank you Jim and Bert,
> >
lapply(mylist,function(x) write.table(x,file = test.txt))
Show Traceback
Error in (function (..., row.names = NULL, check.rows = FALSE,
check.names = TRUE, :
arguments imply differing number of rows: 4, 3
On Sun, Dec 16, 2018 at 8:45 AM Ek Esawi wrote:
>
> Thank you Jim and Bert,
>
> I
Hi All,
I have an R object that is made up of N number of lists which are all
of different number of columns and rows. I want to combine the N
lists into a single data frame or write (append) them into text file.
I hope the question is clear and doesn’t require an example. I am
hoping to accompli
*\\s|^[0-9]x.*|.*[P-p]oints.*|.*\\sto\\s.*"
To remove some unwanted entries, I used this formula.
F <- lapply(G, function(x) lapply(x, function (y) lapply(y,
function(z) gsub(S1,"",z
Thanks again--EK
On Fri, Nov 2, 2018 at 11:00 AM Ek Esawi wrote:
>
> Hi All,
>
>
01/02", "01/02 01/02",
Thanks again--EK
On Fri, Nov 2, 2018 at 11:21 AM Jeff Newmiller wrote:
>
> Can you supply the output of
>
> dput(FF)
>
> ?
>
> On November 2, 2018 8:00:08 AM PDT, Ek Esawi wrote:
> >Hi All,
> >
> >I have a list that
Hi All,
I have a list that is made up of nested lists, as shown below. I want
to remove all rows in each sub-list that start with an empty space,
that’s the first entry of a row is blank; for example, on
[[1]][[1]][[1]] Remove row 4,on [[1]][[1]][[3]] remove row 5, on
[[1]][[2]][[1]] remove row 6,
, something seems screwy in the example you showed: For example, the
> [[1]][[2]][[1]] component indicates a 2 x 5 matrix, but I see only 3 columns
> of text. Am I missing something?
>
> Cheers,
> Bert
>
>
>
> On Thu, Oct 25, 2018 at 6:04 PM Ek Esawi wrote:
>>
>&g
Hi All—
I have a list that contains multiple sub-lists and each sub-list
contains multiple sub(sub-lists), each of the sub(sub-lists) is made
up of matrices of text. I want to replace some of the text in some
parts in the matrices on the list. I tried gsub and stringr,
str_remove, but nothing see
work and i will try it and see.
Thank you all.
EK
On Tue, Oct 9, 2018 at 9:44 AM Ek Esawi wrote:
>
> Hi All--
>
> I used base R list.file function to read files from a directory. The
> file names are months (April, August, etc). That's the system reads
> them in alphabetica
(the untested)
> FNs <- sort(match(sub("\\.PDF", "", basename(file.names)), month.name))
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Oct 9, 2018 at 1:38 PM, Ek Esawi wrote:
>>
>> Hi again,
>>
>> I worked
lt;- fnames[ match( sub("\\.PDF", "", fnames ), month.name ) ]
>
>
> On October 9, 2018 6:44:21 AM PDT, Ek Esawi wrote:
> >Hi All--
> >
> >I used base R list.file function to read files from a directory. The
> >file names are months (April, Augus
, pattern =".PDF",full.names = TRUE)
> file.names <- str_remove(file.names,"\\s[0-9][0-9]")
> FNs <- sort(match(sub("\\.PDF", "", file.names), month.name))
> FNs1 <- paste0(month.name[FNs],".","PDF")
> A <- lapply(F
Hi All--
I used base R list.file function to read files from a directory. The
file names are months (April, August, etc). That's the system reads
them in alphabetical order., but i want to reordered them in calendar
order (January, February, ...December).. I thought i might be able to
do it via Re
t; 925-423-1062
> Lab cell 925-724-7509
>
>
>
> On 10/1/18, 3:32 PM, "R-help on behalf of Ek Esawi"
> wrote:
>
> Hi All—
>
> I am using Tabulizer to extract tables from PDF files. Tabulizer
> creates a list of matrices for each set of tab
Hi All—
I am using Tabulizer to extract tables from PDF files. Tabulizer
creates a list of matrices for each set of tables in each document.
My code, below, works well. Then i thought i would use lapply instead
of for loop since it is a little faster and more compact,
but i kept getting an error m
Thank you Bert and Rui. Everything mentioned on your posts was OK with
the exception of a typo in my original post where [a] was instead
[[a]]. I stumbled one something that stated if i delete the
sub-directory and create it it again might work. In my case once that
was done, it worked.
Thanks aga
Hi All,
I am using the R Tabulizer package to extract tables from a set of pdf
files. Tabulizer creates a list of data frames; each corresponds to a
table in a file. My aim is to create a list of lists, one for each
file.i have 8 files
The code below kept giving me the error "Error in
normalizePat
Thank you again Pikal and Bert. Using lapply, as Bert suggested, was
the first thing that i thought of dealing with this question and was
mentioned in my original posting. I just did not know how to implement
it to get the results/form i want. Below is what i did but could not
get it to give me th
bably they would be
> different from yours and also the result would not be necessary the same as
> you expect.
>
> You should post those data frames as output from dput(data) and show us real
> desired result from those example data frames.
>
> Cheers
> Petr
>
&g
Hi All--
I have generated several 2 column data frames with variable length. The
data frames have the same column names and variable types. I was trying to
aggregate over the 2nd column for all the date frames, but could not figure
out how.
I thought i could make them all of equal length then co
The reason you get "" is, as stated on the previous response and on
the documentation of substr function, the function "When extracting,
if start is larger than the string length then "" is returned.". This
is what happens on your function.
HTH
EK
On Sun, Jan 21, 2018 at 3:59 AM, Luigi Marongiu
Thank you all. Now everything works. Happy 2018 and beyond
EK
On Sun, Jan 7, 2018 at 10:13 PM, Ek Esawi wrote:
> Hi all--
>
> I stumbled on this problem online. I did not like the solution given
> there which was a long UDF. I thought why cannot split and l/s apply
> work her
code is mangled. Can you
> post plain text and use the reprex package to make sure it produces the
> errorin a clean R session?
> --
> Sent from my phone. Please excuse my brevity.
>
> On January 8, 2018 8:03:45 AM PST, Ek Esawi wrote:
>>Thank you Jeff. Your code works,
gt; #> 1 a aaT 2
> #> 2 a abF 2
> #> 3 a acF 2
> #> 4 b aaT 5
> #> 5 b abF 5
> #
>
>
> On Sun, 7 Jan 2018, Jeff Newmiller wrote:
>
>> Why do you want to modify df1?
I just came up with a solution right after i posted the question, but
i figured there must be a better and shorter one.than my solution
sdf1[[1]][1,4]<-lapplyresults[[1]]
sdf1[[2]][1,4]<-lapplyresults[[2]]
EK
On Sun, Jan 7, 2018 at 10:13 PM, Ek Esawi wrote:
> Hi all--
>
> I s
Hi all--
I stumbled on this problem online. I did not like the solution given
there which was a long UDF. I thought why cannot split and l/s apply
work here. My aim is to split the data frame, use l/sapply, make
changes on the split lists and combine the split lists to new data
frame with the desi
Hi Pablo,
Rui's suggestion is probably the best and easiest. In addition to
Eric's, i think the apply functions will work well here too.
Best of luck,
EK
On Thu, Dec 28, 2017 at 7:03 PM, PABLO ORTIZ PINEDA
wrote:
> Hello there. Happy new year for everyone!
>
> I need help with a table. This ta
Hi Val—
Here is something similar to what Bill suggested.
wainb <- which(tdat$A %in% tdat$B)
tdat[c(length(tdat$D)-1,length(tdat$D)),c("D","E")] <-
tdat[wainb,c("B","C")]
HTH
EK
On Wed, Dec 13, 2017 at 4:36 PM, Val wrote:
> Hi all,
>
> I have a data frame
> tdat <- read.table(textConnection(
HI--
How about this one. It produces the desired result. If you have more
conditions, you can put them in a matrix/DF form and subset as suggested by
one of the previous suggestion.
DM[(DM$GR=="A"&DM$x>=15&DM$x<=30)|(DM$GR=="B"&DM$x>=40&DM$x<=50)|(DM
$GR=="C"&DM$x>=60&DM$x<=70),]
EK
On Sat, De
As Burt and Jeff stated that there is an infinite set of solutions. If you
are interested in a particular solution, such as getting 15.0078, you can
easily achieve that by trial and error; that is fix 1 or 2 variables and
change the the rest till you get the desired solution.
I tried that and came
Hi Love,
I am not sure if I understand your question and it will help if you
provided a sample data frame, sample of your code and sample of your output
and the output you desire. Having said that, I think you could use cbind to
join all datasets into a matrix and use the apply family of functions
luck
EK
a <- grep("_flag",colnames(mydf))
b <- mydf[,a]==0
c <- mydf[,a-1]
c[b] <- NA
mydf[,a-1] <- c
mydf
A A_flag B B_flag
1 8 10 5 12
2 NA 0 6 9
3 10 1 NA 0
4 NA 0 1 5
5 5 2 NA 0
On Wed, Nov 22, 2017 at 8:44 AM
OPS,
Sorry i did not read the post carfully. Mine will not work if you have
zeros on columns A and B.. But you could modify it to work for specific
columns i believe.
EK
On Wed, Nov 22, 2017 at 8:37 AM, Ek Esawi wrote:
> Hi *Massimo,*
>
> *Try this.*
>
> *a <- mydf==0
Hi *Massimo,*
*Try this.*
*a <- mydf==0mydf[a] <- NAHTHEK*
On Wed, Nov 22, 2017 at 5:34 AM, Massimo Bressan <
massimo.bres...@arpa.veneto.it> wrote:
>
>
> Given this data frame (a simplified, essential reproducible example)
>
>
>
>
> A<-c(8,7,10,1,5)
>
> A_flag<-c(10,0,1,0,2)
>
> B<-c(5,6,2,1,0
What was suggested by Eric and Rui works well, but here is a short and may
be simpler answer provided your data is similar what Eric posted. It should
work for your l data too.
aa <- is.na(data)|data==0
nrow(data)-colSums(aa)
EK
On Sun, Oct 29, 2017 at 6:25 AM, Engin YILMAZ wrote:
> Dear R Sta
Since i could not see your data, the easiest thing comes to mind is court
values excluding NAs, is something like this
sum(!is.na(x))
Best of luck--EK
On Sun, Oct 29, 2017 at 6:25 AM, Engin YILMAZ wrote:
> Dear R Staff
>
> You can see my data.csv file in the annex.
>
> I try to count non-zero v
z <- x[x[,2]==0&!is.na(x[,2]),] seems to work and get you what you want,
but doesn't answer your question,
z <- x[x[,2]==0&!is.na(x[,2]),]
Best of luck,
EK
On Tue, Oct 24, 2017 at 3:05 PM, BooBoo wrote:
> This has every appearance of being a bug. If it is not a bug, can someone
> tell me what
I would try fininterval as well. It should do what you have asked provided
that you take care of the issue Ulrik pointed out.
Best of luck--EK
On Fri, Sep 8, 2017 at 6:15 AM, Hemant Sain wrote:
> i have a vector containing values ranging from 0 to 24
> i want to create another variable which can
Allaisone 1 allaisone1 at hotmail.com
Mon May 22 02:10:10 CEST 2017
Hi All—
I am curious as to whether there is a vectorized solution using base R
functions, instead of looping and if statements, to the problem below. I
have seen several posts that address a similar question which generally ask
to
Thank you so much Jim. I forgot to state that i was hoping to get it
without loops if possible.
Thanks again,
EK
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mai
Hi All—
I was looking at a posting from June-17. I managed to solve it. However,
when I changed the example in the posting, my solution will work only once
at a time which was mentioned by Jim Lemon on his response to the original
posting. This means that my solution will have to be repeated as m
Hi--
concept_df$NewCol <- "";
kw <- "acid|ph";
bb <- grepl(kw,concept_df$concept)
concept_df[dd,2] <- "chemical"
The is a bit late but it accomplish the same with base R.
Good luck--EK
PS.. my email doesn't accept reply
[[alternative HTML version deleted]]
I have a data.table which is shown below. I want to count combinations of
columns on i and count on j with by. A few examples are given below the
table.
I want to:
all months to show on the output including those that they have zero value
I want the three statements combined in on if possible
; Perhaps look closely at [1], or Google for data table aggregation yourself?
>
> [1] https://www.r-bloggers.com/efficient-aggregation-and-
> more-using-data-table/amp/
> --
> Sent from my phone. Please excuse my brevity.
>
> On May 3, 2017 8:17:21 AM PDT, Ek Esawi wrote:
>
11
17: 17 black E 101 February 17
18: 18red F90 July 21
19: 19red F 112 February 13
20: 20red F 101 July 20
On Tue, May 2, 2017 at 12:35 PM, Ek Esawi wrote:
> I have a huge data file; a sample is listed below. I am using the package
I have a huge data file; a sample is listed below. I am using the package
data table to process the file and I am stuck on one issue and need some
feedback. I used fread to create a data table. Then I divided the data
table (named File1) into 10 general subsets using common table commands
such as:
Hi All—
I am often working with large datasets with multiple variables (integer,
decimal, string, complex, date, and time) that require processing,
cleaning, etc. I am relatively new to R and I would like to get some input
on the following issue: I am trying to figure out which R-package(s) is
mos
Thank you Jeff and Don. As I stated on my original posting that I am
relatively new to R. After a few weeks of searching and reading I have come
to the same point that Don made which is base R doesn’t have a class for
time only. I explored the chron and lubridate packages and even looked at Ecfun
p
Thanks for the responses i received from David and Spencer. As for the
package Ecfun, i looked at it briefly, but it's long and i am new to R; so
this just adds to my confusion. David suggested the sub function which i
will try and see what i get.i s
As i said earlier i have no problems reading da
Thanks Petr!
I am still unable to come up with a conversion formula/trick to convert my
time data to POSIXlt which then can be used in read.table. Below are again
a few lines from my file. Since as you see there are several columns of
time data ONLY (no date), I am hoping that there is a way to
Thanks Jim!
The problem is not date data. The problem is time. I figured out that I can
use chron library and then use this expression times(paste0(t2, ":00"))
because my time data are not h:m:s, only h;m.
The problem I am trying to figure out is how to implement [times(paste0(t2,
":00"))] on c
Hi All--
I am relatively new to R. I am reading a csv file via read.table (MyFile).
The data types in the file are date, string, integer, and time. I was able
to read all the data and manipulated correctly except time, e.g., 12:30. I
used as.Date to convert date and string and integer were easil
71 matches
Mail list logo