We help IT Professionals succeed at work.

R

175

Solutions

357

Contributors

R is a programming language and environment used primarily for statistical data analysis.

Hi,
I would like some help with importing data into R from SQL Developers 2019.
I was able to connect and the file is displayed in the top section of the console.
What I need is the command line to import into R
The file is in SQL dir  RaceData\TestR
Many Thanks
Ian

Please see attached.
2020-04-01-14_54_59-RStudio.png
0
Hi all ia am going well with my script to check for a program and if its not there then run another program, my issue is that even if its find that the program is there it will try to run it any way, on a leavel of 1 to 100 how good am at code maybe 40 so forgive me if it is a dumb mistake, here isthe code , i might be completely wrong so pelase tell me if i am

# Created By ADBY IT AND MEDIA SOLUTIONS
# Adam R Wolarczuk
# 19th March 2020
# Version 0.1
# Beta


# Class for Detect if program is running
import psutil
import subprocess
import pyautogui
import time

for p in psutil.process_iter(attrs=['pid', 'name']):
    if p.info['name'] == "Discord.exe":
        print("yes", (p.info['name']))

    else:
        print("I am here")
        subprocess.Popen(r"C:\FrazerClient\FrazerClient.exe")
        #print("no", (p.info['name']))


# If Program is running
# if the program is not running
# Log to file
# send email to imporm report
0
How do I create a Case Statetment that deletes all ConsultantIDs that have an R and/or S?


ConsultantID
1001004
1001004R
1001004S
200311
200311R
200311S
0
Hi i have a question on the below dynamic sql on the third line. why r they passing @np in sp_executesql ? @nsql is doing a simple SELECT. then what
is @np doing there ?

set @nsql = 'Select @Date = [Date] from  ' +  @ControlFileName  + '  where  ExtractType      =  @ExtractType   and  ProcessType      =  @ProcessType'
            set @np = '@ExtractType  varchar(50),  @ProcessType varchar(50), @Date Date output'
            execute sp_executesql @nsql, @np, @ExtractType=@ExtractType, @ProcessType='MULTILEG', @Date=@Date output

can someone please explain ?
0
Are there any recommended Python, R and SQL source code samples which should read for learning purpose and which can be downloaded from GitHub?
0
VB application that sends PowerShell commands and receives the output.

I am putting the output in to a List view.

The following works fine:

 
[code]      For Each ID In PSOut

            i = i + 1

            'Dim str(6) As String
            Dim str(ColumnCount) As String
            Dim ItCount As Integer = 0
            Dim itm As ListViewItem

            '     Do While ItCount < ColumnCount
            For Each strHeadDSingle In strHeadD2
                str(ItCount) = ID.Properties("name").Value.ToString() ' ### WORKS FINE
                ItCount = ItCount + 1
            Next
            '    Loop
            '         Name, SamAccountName, EmailAddress, PrimarySMTPAddress, UserPrincipalName, DistinguishedName, Enabled"

            itm = New ListViewItem(str)
            ListView1.Items.Insert(0, itm)
        Next

Open in new window

[/code]


When passed as a variable I get the following:

  For Each ID In PSOut

            i = i + 1

            'Dim str(6) As String
            Dim str(ColumnCount) As String
            Dim ItCount As Integer = 0
            Dim itm As ListViewItem

            '     Do While ItCount < ColumnCount
            For Each strHeadDSingle In strHeadD2
                str(ItCount) = ID.Properties(strHeadDSingle).Value.ToString()          ' ### ERRORS THIS LINE
                ItCount = ItCount + 1
            Next
            '    Loop
            '         Name, SamAccountName, EmailAddress, PrimarySMTPAddress, UserPrincipalName, DistinguishedName, Enabled"

            itm = New ListViewItem(str)
            ListView1.Items.Insert(0, itm)
        Next

Open in new window

     


it works 100% as a stated item.

When I try to make my reusable code I get the following on this line when debugging:

System.NullReferenceException
Object reference not set to an instance of an object.

I have checked and values are there quite happily... but little confused.,

Please advise

Many thanks in advance

R
0
I have a variation on a similar question I posted last week. How can I join these two queries together to produce the output as shown in the attached spreadsheet

select p.Project_Code --THIS CODE CORRECTLY RETURNS PROJECT DETAILS
, p.Name as 'Project Name'
, s.name as 'Project Status'
, r.Name as 'Division Name'
from Project p
left join Project_Status s on p.Project_Status_ID = s.Project_Status_ID
left join region r on p.Region_ID = r.Region_ID
where p.project_code in (1563)

--I NEED TO JOIN ABOVE RESULT WITH BELOW RESULT

select   --count(*) DocCnt  THIS CODE CORRECTLY GETS THE NUMBER OF DOCUMENTS
p.Project_Code, p.name as 'Project Name'/*, s.name as 'Project Status' */
--, de.entity_identifier
--, p.project_id
--,title
--, d.Document_ID
--, coalesce(convert(varchar(12),d.published_date,3),'') 'Pub Date'
--, coalesce(convert(varchar(12),d.modified_date,3),'') 'Mod Date'

from document d
join Document_Entities de on d.Document_ID = de.Document_ID
join entity_class EC on de.Entity_Class_ID = ec.Entity_Class_ID and ec.Entity_Class_ID = 3
join Project p on p.Project_ID = de.Entity_Identifier
join Project_Status s on p.Project_Status_ID = s.Project_Status_ID
where p.project_code in (1563)
Book1.xlsx
0
After several problems to install SQL Server 2016 by one of our developers, I got involved to try and assist.  Too much to go into here but it seems they had apparently installed/de-installed/re-installed SQL Server several times before involving me.  

Based on what they said they wanted installed, we were able to successfully install SQL Server 2016 except we got an error for R services saying the user "MSSQLSERVER01" user already existed.  

I'm not a SQL server expert by far so I'm not entirely sure if this "error" means the R installation failed completely or if it simply wasn't able to create the user and so just continued on with the other steps it would have done.

In looking around, I see there are 20 MSSQLSERVERxx  users in the Local Users Group (MSSQLSERVER01-MSSQLSERVER20).

I have some questions:
1.  Am I correct in assuming that this may be because of the multiple installation attempts?   And that it's likely the last installation done may be using the MSSQLSERVER20 user instead of "01"?

2. How can can I know which MSSQLSERVERxx user is being used by R Service?

3. Can I uninstall the R-Services, delete the MSSQLSERVERxx users and install R-Services again?

4. Should I just uninstall SQL Server and do the clean up of the MSSQLSERVERxx users and try the install again.

This database is to used for the BizTalk Microsoft product and at this point we aren't sure if R Services is required.  The developer is looking into that for me at this …
0
Dim xlApp As Object
Dim xlBook As Object
Dim xlSheet As Object
Dim xlRange As Object
Dim cell As Object
Dim val As Variant
Dim adrs As String
 
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(sFile)
 
       Set xlSheet = xlBook.Sheets(5)
        xlApp.Visible = True
        Set rsCurr = CurrentDb.QueryDefs("qtblDebitBranchsReportingReport").OpenRecordset
        xlSheet.Range("B12").CopyFromRecordset rsCurr
        xlSheet.Range("A7").CopyFromRecordset rsCurr
 
        Dim R As Long, ColorValue As Long


            For R = 2 To xlSheet.Application.cells(xlBook.Sheets(5).Rows.Count, "C").End(xlUp).Row

                If xlSheet.Application.cells(R, "C").Value Like "*something*" Or xlSheet.Application.cells(R, "C").Value Like "*something2*" Then
                    xlBook.Sheets(5).Rows(R).Interior.Color = 1763209
                End If
            Next
0
We have a web application in PHP (LAMP)  which works pretty well.

We sell this app to companies directly. It is no for general use. So every time we sell it we installed in an AWS instance and provide the IP address and credentials to the customer.

This app is designed to work with a browser.

If I would like to convert this app to another languaje, like Go, which languaje would you reccomend that?

Thanks

Luis R
0
I have 2 of Dell Server PowerEdge R 510.
Both have got Windows 2019 Server as the OS right now.
I have a SAN (Storage Area Network) which is Dell PowerVault MD 3200 (12@ SAS 600GB).
I installed the “MDSM” (management software Dell Modular Disk Storage Manager at each of R 510); accordingly, from both of the R 510, I can see the MD 3200.

The Goal: I want to create some virtual machines at both R 510 which get the storage from MD 3200.

Note: I do have a little knowledge of Dell Server and no experience in VM machines; I have recently worked with Dell servers; This forum has helped me a lot; something like, it is big challenges in installing Win Server 2019 at R 510 which is INSTALLED now at both R 510, ETC.

Question: How to configure the SAN so it can be linked to VM machines at R 510?

tjie
0
How to modify the following query to add a total column of TaskSelected?

TRANSFORM COUNT(T.TaskSelected)
SELECT R.TAID, T.TaskSelected
FROM RBWS R
LEFT JOIN TaskSelected T  ON R.TaskSelectedID=T.ID
GROUP BY R.TAID
PIVOT T.TaskSelected
0
Hi All,

Please advise on the best way in a module to select query from a MSSQL db.
I have enabled ODBC etc... in PHP settings.
Have setup the DSN.
Not having much joy at all. Can query MySQL DB's of course .. but do not think I can get MSSQL to work.
Possibly I am missing an extension.

Do not want to post any code as I have tried all sorts.
I am happy with the Select.. just need to get the MSSQL connection right.

Would like to see an example I can drop into my custom extension within a module.

PHP 7.3.9
Joomla 3.9.12
Plesk 17.8.11
OS: Windows 2016.

Many thanks in advance

R
0
Hi,

Server#1(Dell R510): it is at 135 subnet
Server#2 (Dell R 510): it is at 135 subnet
The SAN (Dell MD 3200): it is at 135 subnet

Server#1, server#2 and MD 3200 are located  in the data center (Colo).

From Office (It is at different location with Colo), I can do the followings:
I can RDP to Server#1 (which from it, I can see “all network drives”),
I can install the Management software for the SAN (=Management Software Dell Modular Disk Storage Manager “MDSM”) at Server#1 remotely, then when I launch the MDSM, I can see the SAN (MD3200)

But from Server#2, I cannot see or connect to "any network drives"

Question: Why i can not see any network drives from Server#2?

tjie
0
Hi,

I have SAN Dell MD 3200:
+ We can access it through IP address
+ I have management cable which can access this SAN
+ This SAN will be used for Dell R 510 servers.

I have never experienced dealing with the SAN.

Question: Why do we need to know ADMIN PASSWORD of this MD 3200?

Thanks,
tjie
0
I am trying to learn R programming and I do not see how the following command

M = matrix( c(2,6,5,1,10,4), nrow = 2,ncol = 3,byrow = TRUE)
v = M %*% t(M)
print(v)

Open in new window


gives this output
     [,1] [,2]
[1,]   65   82
[2,]   82  117

Open in new window


when i do
 print(M)
print(t(M))

Open in new window


i see
     [,1] [,2] [,3]
[1,]    2    6    5
[2,]    1   10    4
     [,1] [,2]
[1,]    2    1
[2,]    6   10
[3,]    5    4

Open in new window


but i am not seeing how that results in
     [,1] [,2]
[1,]   65   82
[2,]   82  117

Open in new window

0
When I try to install grobi by install.packages, it fails with the attached warning. I tried R-Studio version 3.4.2 and other. However, it shows the same error message like it says "package 'gurobi' is not available (for R version 3.4.2).   It's appreciate if I can know how to install 'gurobi'.
gurobi_not_available.JPG
0
Text file to excel.
I have two set of txt file and I can import to a sheet of excel.(sheet name: R, S) But I want to import to one sheet using VBA.
Also, I want to delete duplicate value(name column) from each set of data(ex, lee from sheet R, kim and lee from sheet S)
Is it possible ?

Thank you.
0
Hi,

Finally, My Dell Power Edge R 510 is running Windows Server 2019 (actually, it is a straight forward installation).

Now, I want to install VM machines in this server.

As Dell Server, my experience in VM machine is also limited.
Can somebody direct me what would I do to create the Hyper V server 2019?

Thanks,
tjie
0
I've below code to SelectFolderDialog in my previous vb.net application. I'm trying to implement it to c# but didn't succeeded.

Can anyone help me to convert it to C# or any additional solution would be grateful.

Public Class SelectFolderDialog
    Implements IDisposable

    ' Wrapped dialog
    Private OFD As System.Windows.Forms.OpenFileDialog = Nothing

    ''' <summary>
    ''' Initialize our Open File Dialog object
    ''' </summary>
    Public Sub New()
        OFD = New System.Windows.Forms.OpenFileDialog()

        With OFD
            .Filter = "Folders|" & vbLf
            .AddExtension = False
            .CheckFileExists = False
            .DereferenceLinks = True
            .Multiselect = False
        End With
    End Sub

#Region "Properties"

    ''' <summary>
    ''' Gets/Sets the initial folder to be selected. A value of Nothing or Emplty selects the current directory.
    ''' </summary>
    Public Property InitialDirectory() As String
        Get
            Return OFD.InitialDirectory
        End Get
        Set(value As String)
            OFD.InitialDirectory = CType(IIf(value Is Nothing OrElse value.Length = 0, Environment.CurrentDirectory, value), String)
        End Set
    End Property

    ''' <summary>
    ''' Gets/Sets the title to show in the dialog. A value of Nothing or Empty defaults to 'Select a folder'
    ''' </summary>
    Public Property Title() As String
        Get
            Return OFD.Title
        End Get
        

Open in new window

0
Starting with a string representing a range:
string sortRange = "C10:H24";

Open in new window

This then works:
worksheet.Range[sortRange].Sort(worksheet.Range[sortRange].Columns[1], xlSortOder.xlDescending);

Open in new window

I saw worksheet.Range[sortRange] was listed twice, so I decided to refactor that out:
Excel.Range r = worksheet.Range[sortRange];
Excel.Range c = r.Columns[1];
r.Sort(c, xlSortOrder.xlDescending);

Open in new window

My refactored version gives a much different result. Why is that?
1
I thought I knew how to do this after my last post, but apparently not.  I have the following code which works fine, however, the output needs to list groups from the profile table that have no entries at all.  So, when I run the code currently, I get all the groups that have registered individuals.  However, there may be some groups that have no registered individuals and they should show up as 0, however they don't.

With TOTAL_REGISTERED as 
(select r.regdate, r.Agency
FROM   tblOrgProfile p 

LEFT JOIN tblOrgRegistrations r
ON p.AgencyID = r.AgencyID
and r.fiscal = 2020

 where active = 1 and
 r.agency <> 'Administrator')

select Agency, 
SUM(CASE when regdate >= '7/1/2019' And regdate < '10/01/2019' then 1 end) as [1st Quarter],
SUM(CASE when regdate >= '10/01/2019' And regdate < '01/01/2019' then 1 ELSE 0 end) as [2nd Quarter],
SUM(CASE when regdate >= '01/01/2020' And regdate < '04/01/2020' then 1 ELSE 0 end) as [3rd Quarter],
SUM(CASE when regdate >= '04/01/2020' And regdate < '07/01/2020' then 1 ELSE 0 end) as [4th Quarter]
from TOTAL_REGISTERED T group by Agency order by agency

Open in new window


Please note that the tables attached do not reflect exactly all the data in the actual tables.
tblOrgProfile.xlsx
tblOrgRegistrations.xlsx
0
Q: How to unite interaction columns from R emmeans package dynamically generated in R-Shiny?

I am building an R-Shiny app where I need to wrangle the output from the 'emmeans' package. However, in this interactive environment where many factors may be entered by the user, the single-tibble 'emmeans' output structure will vary with each run depending on the selections made. It could go from having only a single main effect to having multiple 3-way interactions (mixed with main effects and 2-way interactions) arranged in a wide format way.

For instance, assuming the user selects FctrA (with levels A and B) and FctrB (with levels C, D, and E), the interaction FctrA_FctrB will be automatically considered as well. When (~FctrA, ~FctrB, ~FctrA+FctrB) are submitted to 'emmeans', the output tibble is structured as follows:

- the leftmost side of the tibble contains FctrA results (levels, estimates, SE, df, CLs);
- the certermost block contains FctrB results;
- the rightmost side of the tibble contains the interaction results

So far so good except that FctrA levels columns is a single column, FctrB levels column is also a single column, but the interaction portion has its levels split into two columns, one with FctrA and one with FctrB.

The above issue impairs gathering, spreading, stacking of the separate blocks owing to the dimensional discrepancy.

My question is: How can I tell Shiny ('tidyr') to find those split interaction columns and concatenate them …
0
Hi I have a Dell Perc 740p RAID card I just put in a computer, the computer recognizes it but I can't get in with ctrl + R.  I see the post message, but this one dosen't say press ctrl + R to get into Bios.  it says...

"PowerEdge Expandable RAID controller BIOS copyright AVAGO Technologies"

Then Initializing virtual drives, then goes on it's marry way.

Question: is there another way to get into Bios?  Am I dooing something wrong?

Thanks all
0
hi,

I have a study on ETL tools and recently heard a lot of voice on just need to do ETL programming using script/coding, e.g. R and Qview, so is this means now ETL tools like MS SSIS is useless ?

what is the pros and cons on doing ETL logic by coding and ETL tools?

it seems now doing ETL code in container level with RESTFUL API already make ETL process can do load balancing, parallel execution and scale out (by container), is that correct ? so no need ETL tools any more ???

the new MariaDB X3 platform seems can even ignore ETL process as it can stream data directly form OLTP to OLAP, so not need ETL anymore?
0

R

175

Solutions

357

Contributors

R is a programming language and environment used primarily for statistical data analysis.

Top Experts In
R
<
Monthly
>