Dear R-Users and experts,
This is my first post in this forum.
I have two csv files file1 and file2.
file1(many rows and columns) is read into dataframe *data1*
File2 is read into dataframe *data2* which have only one column of data
which contains the column names that need to be removed from data
Thanks Arun for your quick reply.. Short code.. but brilliant.
It works very well for my requirement. My actual data has thousands of
columns fed into random forest model where I need to remove some of the
columns fed from another file by keep adding/removing the input sensors.
Thanks once again.
Hi Experts,
This might be silly question that I am asking, but no way as I am new to
R.
I want to list the files in a directory using regular expression like
A_B*_C*.csv etc.
How to make this possible in R ?
I tried like this list.files(dir=".", pattern="A_B*_C*.csv") but this gives
no output
Hi Gabor,
Thanks for your reply..
*glob2rx()* function works for my requirement to address global
pattern(using *) of files like we use in Unix shell.
Sidda
--
View this message in context:
http://r.789695.n4.nabble.com/listing-the-files-in-a-directory-using-regular-expressions-tp464
Hello all,
I have a .csv file like below.
Tool,Step_Number,Data1,Data2... etc up to 100 columns.
A,1,0,1
A,2,3,1
A,3,2,1
.
.
B,1,3,2
B,2,1,2
B,3,3,2
.
.
.. so on upto 50 rows
where the column "*Tool*" has distinct steps in second column
"*Step_Number*",but both have same entries in Step_Numbe
Hi Jeff Newmiller,
The script given by you is perfect for my requirement.
The rest of the scripts given by other authors are failing to format the
file header which are giving like eachdatacolumn.1 or eachdatacolumn.2 etc,
whereas I need them as eachdatacolumn_firstactualstepnumber,
eachdata
Hi All,
I have a data frame where nearly 10K columns of data, where most of them
have standard deviation( of all rows) as zero.
I want to exclude all the columns from the data frame and proceed to further
processing.
I tried like blow.
*data <- read.csv("data.CSV", header=T)
for(i in 2:ncol(
Hello All,
I use Cygwin ( unix on windows) heavily for all my text data processing.
Also use Cygwin inbuilt *R* to do numerical processing.
*My aim is to integrate R and unix commands to avoid heavy memory usage that
R takes normally.*
I can run many unix commands using system("some unix comma
Thanks William,
This solved my problem very well. Look like I asked a very trivial
question.
-
Sidda
Business Analyst Lead
Applied Materials Inc.
--
View this message in context:
http://r.789695.n4.nabble.com/Getting-error-while-running-unix-commands-within-R-using-system-function
Hello All,
I have a .csv file( contents shown) below, where I need to calculate
mean(for example) for only the rows highlighted in bold. (i.e. in this
example case I need to exclude the first row and last row(N=1) for each
"*StepNo*" column)
Unique,StepNo,Data1,Data2#In actual file I have
Hi Arun,
Thanks for your reply but your script is removing only one row( first row
and last row) for each Unique and StepNo combination and calculating mean
for the rest of rows.
For below data , your script removing the #'s rows perfectly.
But in reality I may need to ignore *say first 10 rows
Hi Jeff,
First of all I am not a good programmer in R.
I have a 2 line code in shell script using awk, head, tail and for loop
combination that accomplish this task.
So I thought of using R itself to do this task but I don't have any idea how
to do it in R.
Any way I will try to learn my own wh
Thanks Arun.. I appreciate your time.. in making the generic script.
I believe that this is not a very trivial question..
-
Sidda
Business Analyst Lead
Applied Materials Inc.
--
View this message in context:
http://r.789695.n4.nabble.com/Excluding-fixed-number-of-rows-from-calculatio
13 matches
Mail list logo